FROM node:lts-alpine as build-stageARG PROFILEWORKDIR /appCOPY package*.json ./RUN npm install -g cnpm --registry=https://registry.npm.taobao.orgRUN cnpm installCOPY . .RUN npm run build:${PROFILE}# production stageFROM nginx:latest as production-stageARG PROFILECOPY nginx/nginx-${PROFILE}.conf /etc/nginx/nginx.confCOPY --from=build-stage /app/dist /usr/share/nginx/htmlEXPOSE 80CMD ["nginx", "-g", "daemon off;"]
