Dockerfile 401 B

1234567891011121314
  1. FROM registry.cn-shanghai.aliyuncs.com/lwmeng/node:lts-alpine as build-stage
  2. WORKDIR /app
  3. COPY package*.json ./
  4. RUN npm install -g cnpm --registry=https://registry.npmmirror.com
  5. RUN cnpm install
  6. COPY . .
  7. RUN npm run build:prod
  8. # production stage
  9. FROM registry.cn-shanghai.aliyuncs.com/lwmeng/nginx
  10. COPY --from=build-stage /app/dist /usr/share/nginx/html
  11. EXPOSE 80
  12. CMD ["nginx", "-g", "daemon off;"]