FROM node:lts as dist

WORKDIR /src

COPY . .

RUN yarn && \
    yarn build:prod


FROM nginx:1.19.2

WORKDIR /app

COPY --from=dist /src/dist .

COPY nginx.conf /etc/nginx/nginx.conf

EXPOSE 80

CMD ["nginx","-g","daemon off;"]