 FROM node:16 as builder
WORKDIR /usr/src/postamates_frontend
COPY package*.json ./
COPY yarn.lock ./
RUN yarn install
COPY . . 
ARG REACT_APP_DOMAIN_URL=https://${DOMAIN}/
ENV NODE_OPTIONS=--max_old_space_size=4096
RUN yarn build

FROM nginx:1.23-alpine
COPY --from=builder /usr/src/postamates_frontend/dist /opt/site
COPY nginx.conf /etc/nginx/nginx.conf 