24 lines
503 B
Docker
24 lines
503 B
Docker
# ---- Build stage ----
|
|
FROM node:20-bookworm-slim AS builder
|
|
WORKDIR /app
|
|
|
|
# nur Manifeste kopieren
|
|
COPY package.json ./
|
|
|
|
# npm robuster machen (optional, aber hilft)
|
|
RUN npm i -g npm@9
|
|
RUN npm ci --no-audit --no-fund
|
|
|
|
# restlichen Code kopieren (ohne node_modules dank .dockerignore)
|
|
COPY . .
|
|
|
|
# Build
|
|
RUN npm run build
|
|
|
|
# ---- Runtime ----
|
|
FROM nginx:alpine
|
|
COPY --from=builder /app/dist /usr/share/nginx/html
|
|
COPY nginx.conf /etc/nginx/conf.d/default.conf
|
|
EXPOSE 80
|
|
CMD ["nginx","-g","daemon off;"]
|