# Frontend Dockerfile - Node with Static Serving # Optimized for production with minimal size FROM node:18-alpine as builder WORKDIR /app # Copy frontend COPY frontend/package.json frontend/package-lock.json ./ COPY frontend/. ./ # Install dependencies RUN npm ci # Build production bundle RUN npm run build # Runtime stage - nginx lightweight server FROM node:18-alpine WORKDIR /app # Copy built files COPY --from=builder /app/dist ./dist # Install global serve package for static file serving RUN npm install -g serve # Health check HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \ CMD wget --quiet --tries=1 --spider http://localhost:5173 || exit 1 # Expose port EXPOSE 5173 # Start static server CMD ["serve", "-s", "dist", "-l", "5173"]