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