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 AS base
FROM node:20-alpine
WORKDIR /usr/src/app
# Dependencies installieren (dev deps für Build erforderlich)
# Package-Dateien
COPY package*.json ./
# Dev + Prod Dependencies (für TS-Build nötig)
RUN npm install
# Quellcode kopieren
# Restlicher Sourcecode
COPY . .
# Build ausführen (TypeScript -> dist)
RUN npx tsc --skipLibCheck --noEmitOnError false
# --------- 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
# TypeScript Build
RUN npm run build
# Port freigeben
EXPOSE 3100
# App starten
CMD ["npm", "start"]
# Start der App
CMD ["node", "dist/index.js"]