# Build stage FROM node:20.18-alpine AS build WORKDIR /app # Copy package files COPY package*.json ./ # Install dependencies from lockfile (DW-3) RUN npm ci # Copy source files COPY . . # Build the application RUN npm run build # Production stage — unprivileged nginx (runs as non-root, listens on 8080) FROM nginxinc/nginx-unprivileged:1.27-alpine # Copy built files from build stage COPY --from=build /app/dist /usr/share/nginx/html # Copy nginx configuration COPY nginx.conf /etc/nginx/conf.d/default.conf COPY proxy-params.conf /etc/nginx/proxy-params.conf # Expose port 8080 (unprivileged) EXPOSE 8080 # Start nginx CMD ["nginx", "-g", "daemon off;"]