From 259f7707bceec1d64e877bd78502ce95d9119d81 Mon Sep 17 00:00:00 2001 From: Kenzo Date: Sat, 8 Nov 2025 17:38:08 +0100 Subject: [PATCH] Optimize Dockerfile for production - Copy `package.json` and `package-lock.json` to install only production dependencies. - Use `npm ci --only=production` for faster and more reliable builds. --- Dockerfile | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Dockerfile b/Dockerfile index a6d5453..a59a2ae 100644 --- a/Dockerfile +++ b/Dockerfile @@ -10,6 +10,13 @@ FROM node:20-alpine AS production WORKDIR /app ENV NODE_ENV=production + +# Kopiere package.json und package-lock.json für Produktions-Abhängigkeiten +COPY package*.json ./ +# Installiere nur Produktions-Abhängigkeiten +RUN npm ci --only=production && npm cache clean --force + +# Kopiere das gebaute Projekt COPY --from=build /app/dist ./dist # install minimal deps to run node if needed (alpine already has node)