# ── Stage 1: Build React frontend ───────────────────────────────────────── FROM node:20-alpine AS builder WORKDIR /app COPY frontend/package*.json ./ RUN npm ci COPY frontend/ . RUN npm run build # ── Stage 2: Serve with nginx ────────────────────────────────────────────── FROM nginx:alpine COPY --from=builder /app/dist /usr/share/nginx/html COPY nginx.conf /etc/nginx/conf.d/default.conf EXPOSE 80 HEALTHCHECK --interval=30s --timeout=5s --start-period=10s --retries=3 \ CMD wget -q --spider http://localhost/ || exit 1