# Frontend Dockerfile for edi.chat # Multi-stage build for optimized production image # Stage 1: Build stage FROM node:18-alpine as build # Set working directory WORKDIR /app # Copy package files COPY package*.json ./ # Install dependencies RUN npm ci --only=production --silent # Copy source code COPY . . # Build the application RUN npm run build # Stage 2: Production stage FROM nginx:alpine # Copy custom nginx configuration COPY nginx.conf /etc/nginx/nginx.conf # Copy built application from build stage COPY --from=build /app/build /usr/share/nginx/html # Copy static assets COPY public/edi.chat.png /usr/share/nginx/html/ COPY public/uga-logo.png /usr/share/nginx/html/ # Expose port 80 EXPOSE 80 # Health check HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \ CMD curl -f http://localhost/health || exit 1 # Start nginx CMD ["nginx", "-g", "daemon off;"]