FROM node:14.15.1 AS base
WORKDIR /code
RUN yarn config set registry https://registry.npm.taobao.org/
ADD package.json /code
RUN yarn install
ADD . /code  
RUN yarn build


FROM nginx:1.19-alpine
COPY nginx.conf /etc/nginx/conf.d/nginx.conf
COPY --from=base /code/dist /var/www/html/dist/