Dockerfile 522 B

1234567891011121314151617181920212223242526272829303132
  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. # Copy built application
  16. COPY --from=build /app/dist /usr/share/nginx/html
  17. # Copy nginx configuration
  18. COPY nginx.conf /etc/nginx/conf.d/default.conf
  19. # Expose port
  20. EXPOSE 80
  21. # Start nginx
  22. CMD ["nginx", "-g", "daemon off;"]