FROM node:16 as builder
WORKDIR /code
RUN yarn config set registry https://repo.nju.edu.cn/repository/npm/
RUN yarn config set network-timeout 60000
ADD package.json /code
ADD yarn.lock /code
RUN yarn install
ADD . /code
RUN yarn build:prod

FROM nginx:1.19-alpine
COPY --from=builder /code/dist/ /var/www/html/dist/
