Dockerfile 416 B

1234567891011121314151617181920
  1. # Stage 1: Build Vite React application
  2. FROM docker.m.daocloud.io/library/node:20-alpine AS builder
  3. WORKDIR /app
  4. COPY package*.json ./
  5. RUN npm install
  6. COPY . .
  7. RUN npm run build
  8. # Stage 2: Serve static files via Nginx
  9. FROM docker.m.daocloud.io/library/nginx:alpine
  10. COPY --from=builder /app/dist /usr/share/nginx/html
  11. COPY nginx.conf /etc/nginx/conf.d/default.conf
  12. EXPOSE 80
  13. CMD ["nginx", "-g", "daemon off;"]