FROM node:20.11.1 as builder

WORKDIR /usr/src/app
COPY . /usr/src/app

RUN npm install && npm run build-preprod

FROM nginx:1.14.2-alpine

COPY nginx.conf /etc/nginx/nginx.conf
COPY --from=builder /usr/src/app/dist/ExtraNet /usr/share/nginx/html

EXPOSE 80
EXPOSE 443

CMD ["nginx", "-g", "daemon off;"]