From 607024c8130e48b2d06c6e557a6d52d145a399e5 Mon Sep 17 00:00:00 2001 From: florianfederspiel Date: Sun, 7 Dec 2025 23:06:29 +0100 Subject: [PATCH] Changed Dockerfile --- Dockerfile | 27 +++++++++------------------ 1 file changed, 9 insertions(+), 18 deletions(-) diff --git a/Dockerfile b/Dockerfile index 12566db..cfcb8aa 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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"] \ No newline at end of file +# Start der App +CMD ["node", "dist/index.js"]