Changed Dockerfile

This commit is contained in:
2025-12-07 23:06:29 +01:00
parent 32b46f58a4
commit 607024c813

View File

@@ -1,29 +1,20 @@
# Basis-Image FROM node:20-alpine
FROM node:20-alpine AS base
WORKDIR /usr/src/app WORKDIR /usr/src/app
# Dependencies installieren (dev deps für Build erforderlich) # Package-Dateien
COPY package*.json ./ COPY package*.json ./
# Dev + Prod Dependencies (für TS-Build nötig)
RUN npm install RUN npm install
# Quellcode kopieren # Restlicher Sourcecode
COPY . . COPY . .
# Build ausführen (TypeScript -> dist) # TypeScript Build
RUN npx tsc --skipLibCheck --noEmitOnError false RUN npm run build
# --------- Production Stage ---------
FROM node:20-alpine AS production
WORKDIR /usr/src/app
# Nur production dependencies installieren
COPY package*.json ./
RUN npm install --omit=dev
COPY --from=base /usr/src/app/dist ./dist
# Port freigeben # Port freigeben
EXPOSE 3100 EXPOSE 3100
# App starten # Start der App
CMD ["npm", "start"] CMD ["node", "dist/index.js"]