# Multi-stage build for React frontend # Build stage FROM node:20-alpine as build WORKDIR /app # Copy package files COPY package*.json ./ # Install dependencies # Use npm install instead of npm ci since package-lock.json may not exist RUN npm install # Copy source code COPY . . # Build application RUN npm run build # Production stage with nginx FROM nginx: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 # Expose port EXPOSE 80 CMD ["nginx", "-g", "daemon off;"]