FROM node:12.18-alpine as builder
# FROM node:alpine as builder
# ENV CI=true
ENV NODE_ENV=production  
WORKDIR /usr/app
ENV PATH /usr/app/node_modules/.bin:$PATH
COPY ["package.json", "./"]
RUN yarn
COPY ./ ./
RUN yarn build

FROM nginx
EXPOSE 3000
COPY ./nginx/default.conf /etc/nginx/conf.d/default.conf
COPY --from=builder /usr/app/build /usr/share/nginx/html