2026-02-05 07:36:25 +03:00
|
|
|
# Stage 1: Build
|
|
|
|
|
FROM node:20-alpine AS build-stage
|
|
|
|
|
WORKDIR /app
|
|
|
|
|
COPY package*.json ./
|
2026-10-07 13:07:16 +03:00
|
|
|
RUN npm ci
|
2026-02-05 07:36:25 +03:00
|
|
|
COPY . .
|
|
|
|
|
RUN npm run build
|
|
|
|
|
|
|
|
|
|
# Stage 2: Serve
|
2026-10-07 13:07:16 +03:00
|
|
|
# nginx runs as root here: the image entrypoint renders the template into /etc/nginx/conf.d and port 80
|
|
|
|
|
# is published by docker-compose. An unprivileged variant would change the port and the image.
|
2026-02-05 07:36:25 +03:00
|
|
|
FROM nginx:alpine
|
|
|
|
|
COPY --from=build-stage /app/dist /usr/share/nginx/html
|
2026-02-06 21:14:52 +03:00
|
|
|
COPY default.conf.template /etc/nginx/templates/default.conf.template
|
2026-02-05 07:36:25 +03:00
|
|
|
EXPOSE 80
|
|
|
|
|
CMD ["nginx", "-g", "daemon off;"]
|