FROM node:10.16.0 as node

WORKDIR /app
COPY ./ /app/

# Install Packaged and Build App
RUN yarn global add @angular/cli@~7.3.1
RUN yarn install
RUN yarn build

# Serve app, based on Nginx, to have only the compiled app ready for production with Nginx
FROM nginx:1.13.8-alpine

COPY --from=node /app/dist/playground/ /usr/share/nginx/html
COPY ./nginx.conf /etc/nginx/conf.d/default.conf
