# Multi-stage build for production FROM node:18-alpine as build WORKDIR /app # Copy package files COPY package*.json ./ RUN npm ci --only=production # Copy source code COPY . . # Build the app RUN npm run build # Production stage with nginx FROM nginx:alpine # Copy built app COPY --from=build /app/dist /usr/share/nginx/html # Copy nginx configuration COPY nginx.conf /etc/nginx/nginx.conf # Expose ports EXPOSE 80 443 # Start nginx CMD ["nginx", "-g", "daemon off;"]