12345678910111213141516171819202122232425262728 |
- # Frontend Build Stage
- FROM node:18-alpine as build
- WORKDIR /app
- # Copy package files
- COPY package*.json ./
- RUN npm ci --only=production
- # Copy source code
- COPY . .
- # Build the application
- RUN npm run build
- # Production Stage
- FROM nginx:alpine
- # Copy built application
- COPY --from=build /app/build /usr/share/nginx/html
- # Copy nginx configuration
- COPY nginx.conf /etc/nginx/conf.d/default.conf
- # Expose port
- EXPOSE 3000
- CMD ["nginx", "-g", "daemon off;"]
|