Dockerfile 320 B

123456789101112
  1. FROM node:16-alpine as build-stage
  2. WORKDIR /app
  3. COPY package*.json ./
  4. RUN npm config set registry https://registry.npm.taobao.org
  5. RUN npm install
  6. COPY . .
  7. RUN npm run build
  8. FROM nginx:stable-alpine as production-stage
  9. COPY --from=build-stage /app/dist /usr/share/nginx/html
  10. EXPOSE 80
  11. CMD ["nginx", "-g", "daemon off;"]