yarn多阶段构建vue项目docker镜像

  sre

5fc79e5308dca3906.jpg_fo742.jpg

.dockerignore

node_modules

Dockerfile

FROM node:10 AS builder
WORKDIR /app
COPY . .
RUN yarn install && yarn build

FROM nginx:alpine
WORKDIR /usr/share/nginx/html
RUN rm -rf ./*
COPY --from=builder /app/dist .
ENTRYPOINT ["nginx", "-g", "daemon off;"]

LEAVE A COMMENT

Captcha Code