# Multi-stage build for production FROM node:20-alpine AS build-stage # Set working directory WORKDIR /app # Copy package files COPY package*.json ./ # Install dependencies #ENV NODE_ENV=production RUN npm ci --no-audit --no-fund # Copy source code COPY . . # Build the app RUN npm run build # Production stage FROM nginx:stable-alpine AS production-stage # Copy built assets from build stage COPY --from=build-stage /app/dist /usr/share/nginx/html # Copy custom nginx config COPY nginx.conf /etc/nginx/nginx.conf # Expose port 80 EXPOSE 80 # Start nginx HEALTHCHECK --interval=30s --timeout=3s --retries=3 CMD wget -qO- http://localhost/healthz >/dev/null 2>&1 || exit 1 CMD ["nginx", "-g", "daemon off;"]