Files
Gallus_Pub/Dockerfile
Kenzo 259f7707bc
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed
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.
2025-11-08 17:38:08 +01:00

27 lines
691 B
Docker

FROM node:20-alpine AS build
WORKDIR /app
COPY package*.json ./
RUN npm ci
COPY . .
RUN npm run build
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)
EXPOSE 3000
CMD ["node", "./dist/server/entry.mjs"]
HEALTHCHECK --interval=30s --timeout=5s --start-period=10s --retries=3 \
CMD wget -qO- http://localhost:3000/ || exit 1