# ============================================================================ # DAARION Frontend Dockerfile # Multi-stage build for production # ============================================================================ # Stage 1: Build FROM node:18-alpine AS builder WORKDIR /app # Copy package files COPY package*.json ./ # Install dependencies RUN npm ci --only=production # Copy source COPY . . # Build frontend RUN npm run build # Stage 2: Production FROM nginx:alpine # Copy built files COPY --from=builder /app/dist /usr/share/nginx/html # Copy nginx config for SPA COPY nginx/frontend.conf /etc/nginx/conf.d/default.conf # Expose port EXPOSE 80 # Health check HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \ CMD wget --spider -q http://localhost/health || exit 1 CMD ["nginx", "-g", "daemon off;"]