Dockerfile 472 B

1234567891011121314151617181920212223242526272829
  1. # Build stage
  2. FROM node:18-alpine as builder
  3. WORKDIR /app
  4. # Copy package files
  5. COPY package*.json ./
  6. COPY . .
  7. # Install dependencies
  8. RUN npm ci
  9. # Build the application
  10. RUN npm run build
  11. # Production stage
  12. FROM nginx:alpine
  13. # Copy built assets from builder stage
  14. COPY --from=builder /app/dist /usr/share/nginx/html
  15. # Copy nginx configuration
  16. COPY nginx.conf /etc/nginx/conf.d/default.conf
  17. # Expose port 80
  18. EXPOSE 80
  19. # Start nginx
  20. CMD ["nginx", "-g", "daemon off;"]