Dockerfile 375 B

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