FROM node:10.9.0 AS builder
RUN mkdir /app

WORKDIR /app
RUN npm install -g @angular/cli@8.3 && npm install

COPY . .

RUN npm install

RUN ng build --prod --aot=false --build-optimizer=false --baseHref=/
#RUN ng build --prod --aot=false --build-optimizer=false --baseHref=/

# nginx state for serving content
FROM nginx:1.23.2-alpine

WORKDIR /usr/share/nginx/html
RUN rm -rf ./*
COPY nginx.conf /etc/nginx/conf.d/default.conf
COPY nginx-default.conf /etc/nginx/nginx.conf
COPY --from=builder /app/dist .
EXPOSE 80
EXPOSE 443