FROM node:lts AS source-code
WORKDIR /app
COPY . .
RUN npm install
RUN npm run build


FROM nginx:1.17

WORKDIR /usr/share/nginx/html

COPY --from=source-code /app/dist /usr/share/nginx/html

COPY docker/start.sh /start.sh
RUN chmod uog+rwx /start.sh

EXPOSE 80
CMD [ "/start.sh"]
