This commit is contained in:
2026-01-12 13:33:08 +01:00
parent deec1e33c3
commit efc86e77bd

View File

@@ -1,18 +1,27 @@
FROM node:18-alpine FROM node:18-alpine AS builder
WORKDIR /app WORKDIR /app
# Dependencies installieren # Alle Dependencies installieren (inkl. devDependencies für Build)
COPY package*.json ./ COPY package*.json ./
RUN npm ci --only=production RUN npm ci
# Source kopieren und builden # Source kopieren und builden
COPY tsconfig.json ./ COPY tsconfig.json ./
COPY src ./src COPY src ./src
RUN npm run build RUN npm run build
# Aufräumen - nur dist und node_modules behalten # Production Stage
RUN rm -rf src tsconfig.json FROM node:18-alpine
WORKDIR /app
# Nur Production Dependencies
COPY package*.json ./
RUN npm ci --only=production
# Built files vom Builder kopieren
COPY --from=builder /app/dist ./dist
# Port freigeben # Port freigeben
EXPOSE 3000 EXPOSE 3000