Stufe 0: Grundgerüst mit Rechenkern, Datenbank, Oberfläche und Docker-Betrieb
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AmyPfuNc4sCRfaF3oURXZz
This commit is contained in:
23
Dockerfile
Normal file
23
Dockerfile
Normal file
@@ -0,0 +1,23 @@
|
||||
# syntax=docker/dockerfile:1
|
||||
# Baustufe: Abhängigkeiten, Prüfung, Build
|
||||
FROM node:22-alpine AS build
|
||||
WORKDIR /app
|
||||
COPY package.json package-lock.json ./
|
||||
# Optionales Zertifikat für Netze mit TLS-Proxy: docker build --secret id=ca,src=ca.crt
|
||||
RUN --mount=type=secret,id=ca,required=false NODE_EXTRA_CA_CERTS=/run/secrets/ca npm ci
|
||||
COPY . .
|
||||
RUN npm run typecheck && npx vitest run && NODE_ENV=production npm run build && npm prune --omit=dev
|
||||
|
||||
# Laufzeit: nur was der Server braucht
|
||||
FROM node:22-alpine
|
||||
WORKDIR /app
|
||||
ENV NODE_ENV=production PORT=3000
|
||||
ARG APP_VERSION=entwicklung
|
||||
ENV APP_VERSION=$APP_VERSION
|
||||
COPY --from=build /app/package.json ./
|
||||
COPY --from=build /app/node_modules ./node_modules
|
||||
COPY --from=build /app/dist ./dist
|
||||
USER node
|
||||
EXPOSE 3000
|
||||
HEALTHCHECK --interval=30s --timeout=5s CMD wget -qO- http://localhost:3000/api/status || exit 1
|
||||
CMD ["node", "dist/server/index.js"]
|
||||
Reference in New Issue
Block a user