Dockerfile 584 B

1234567891011121314151617181920212223242526272829303132333435
  1. # Frontend Dockerfile
  2. FROM node:18-alpine AS build
  3. # Set working directory
  4. WORKDIR /app
  5. # Copy package files
  6. COPY package*.json ./
  7. # Install dependencies
  8. RUN npm ci --only=production
  9. # Copy source code
  10. COPY . .
  11. # Build the application
  12. RUN npm run build
  13. # Production stage
  14. FROM nginx:alpine
  15. # Install curl for health checks
  16. RUN apk add --no-cache curl
  17. # Copy built application
  18. COPY --from=build /app/dist /usr/share/nginx/html
  19. # Copy nginx configuration
  20. COPY nginx.conf /etc/nginx/conf.d/default.conf
  21. # Expose port
  22. EXPOSE 80
  23. # Start nginx
  24. CMD ["nginx", "-g", "daemon off;"]