Dockerfile 466 B

123456789101112131415
  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.npm.taobao.org
  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. COPY ./docker/nginx/default.conf /etc/nginx/conf.d/default.conf
  12. EXPOSE 80
  13. CMD ["nginx", "-g", "daemon off;"]