Dockerfile 300 B

123456789101112
  1. FROM node:18-alpine AS build
  2. WORKDIR /app
  3. RUN npm config set registry https://registry.npmmirror.com
  4. COPY package*.json ./
  5. RUN npm ci --legacy-peer-deps
  6. COPY . .
  7. RUN npx vite build
  8. FROM nginx:1.27-alpine
  9. COPY --from=build /app/dist /usr/share/nginx/html
  10. EXPOSE 80
  11. CMD ["nginx", "-g", "daemon off;"]