Optimize Dockerfile for production
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed

- Copy `package.json` and `package-lock.json` to install only production dependencies.
- Use `npm ci --only=production` for faster and more reliable builds.
This commit is contained in:
2025-11-08 17:38:08 +01:00
parent f7521734bf
commit 259f7707bc

View File

@ -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)