FROM node:16.14.2-alpine as build-stage
WORKDIR /app
COPY package*.json ./
RUN npm install
COPY ./ .
RUN npm run build
FROM nginx as production-stage
RUN mkdir /app
COPY --from=build-stage /app/dist /app
COPY nginx.conf /etc/nginx/nginx.conf
ENV NODE_ENV=production
EXPOSE 443
CMD ["nginx", "-g", "daemon off;"]