Skip to content

Commit

Permalink
Revert "BC-8440 Remove devDependencies from docker image (#5419)"
Browse files Browse the repository at this point in the history
This reverts commit 16b9c2c.
  • Loading branch information
mamutmk5 authored Jan 17, 2025
1 parent 9994baf commit 619bda6
Show file tree
Hide file tree
Showing 27 changed files with 48 additions and 413 deletions.
56 changes: 18 additions & 38 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,47 +1,27 @@
FROM docker.io/node:22-alpine AS builder
FROM docker.io/node:22 AS git

RUN mkdir /app && chown -R node:node /app
WORKDIR /app
RUN apk add --no-cache git
COPY .git ./.git

RUN git config --global --add safe.directory /app \
&& echo "{\"sha\": \"$(git rev-parse HEAD)\", \"version\": \"$(git describe --tags --abbrev=0)\", \"commitDate\": \"$(git log -1 --format=%cd --date=format:'%Y-%m-%dT%H:%M:%SZ')\", \"birthdate\": \"$(date +%Y-%m-%dT%H:%M:%SZ)\"}" > /app/serverversion

COPY package.json package-lock.json tsconfig.json tsconfig.build.json nest-cli.json ./
COPY apps apps
COPY config config
COPY esbuild esbuild
COPY src src

RUN npm ci && npm run build

COPY .git .
RUN git config --global --add safe.directory /app && echo "{\"sha\": \"$(git rev-parse HEAD)\", \"version\": \"$(git describe --tags --abbrev=0)\", \"commitDate\": \"$(git log -1 --format=%cd --date=format:'%Y-%m-%dT%H:%M:%SZ')\", \"birthdate\": \"$(date +%Y-%m-%dT%H:%M:%SZ)\"}" > /app/serverversion

FROM docker.io/node:22-alpine

ENV TZ=Europe/Berlin
RUN apk add --no-cache git make python3 curl

RUN apk add --no-cache git make python3
# to run ldap sync as script curl is needed
RUN apk add --no-cache curl
WORKDIR /schulcloud-server

COPY package.json package-lock.json ./
COPY backup backup
COPY config config
COPY scripts/ldapSync.sh scripts/
COPY src src

COPY --from=builder /app/dist dist
COPY --from=builder /app/serverversion dist/apps/server/static-assets/serverversion

# The postinstall script must be disabled, because esbuild is a dev dependency and not installed here.
RUN npm pkg delete scripts.postinstall \
&& npm ci --omit=dev \
&& npm cache clean --force

# The modules transpiled by esbuild need to be copied manually from the build stage.
COPY --from=builder /app/node_modules/@keycloak/keycloak-admin-client-cjs node_modules/@keycloak/keycloak-admin-client-cjs
COPY --from=builder /app/node_modules/file-type-cjs node_modules/file-type-cjs
COPY tsconfig.json tsconfig.build.json package.json package-lock.json .eslintrc.js .eslintignore nest-cli.json ./
COPY esbuild ./esbuild
RUN npm ci && npm cache clean --force
COPY config /schulcloud-server/config
COPY backup /schulcloud-server/backup
COPY src /schulcloud-server/src
COPY apps /schulcloud-server/apps
COPY --from=git /app/serverversion /schulcloud-server/apps/server/static-assets
COPY scripts/ldapSync.sh /schulcloud-server/scripts/
RUN npm run build

ENV NODE_ENV=production
ENV NO_COLOR="true"

CMD npm start
CMD npm run start
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@ import { ExternalTool } from '@modules/tool/external-tool/domain';
import { externalToolFactory } from '@modules/tool/external-tool/testing';
import { SchoolExternalTool } from '@modules/tool/school-external-tool/domain';
import { schoolExternalToolFactory } from '@modules/tool/school-external-tool/testing';
import { MediaUserLicense, MediaUserLicenseService } from '@modules/user-license';
import { mediaUserLicenseFactory } from '@modules/user-license/testing';
import { MediaUserLicense, mediaUserLicenseFactory, MediaUserLicenseService } from '@modules/user-license';
import { ConfigService } from '@nestjs/config';
import { Test, TestingModule } from '@nestjs/testing';
import { FeatureDisabledLoggableException } from '@shared/common/loggable-exception';
Expand Down
164 changes: 0 additions & 164 deletions apps/server/src/modules/management/seed-data/factory/base.factory.ts

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Loading

0 comments on commit 619bda6

Please sign in to comment.