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
# Dependencies installieren
# Alle Dependencies installieren (inkl. devDependencies für Build)
COPY package*.json ./
RUN npm ci --only=production
RUN npm ci
# Source kopieren und builden
COPY tsconfig.json ./
COPY src ./src
RUN npm run build
# Aufräumen - nur dist und node_modules behalten
RUN rm -rf src tsconfig.json
# Production Stage
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
EXPOSE 3000