# Stage 0, "build-stage", based on Node.js, to build and compile the frontend FROM node:14-alpine as build-stage WORKDIR /app COPY package*.json /app/ RUN npm install COPY ./ /app/ RUN npm run build # Stage 1, based on Nginx, to have only the compiled app, ready for production with Nginx FROM nginx:1.16 COPY --from=build-stage /app/build/ /usr/share/nginx/html COPY ./nginx/nginx.conf /etc/nginx/nginx.conf COPY ./nginx/site.prod.conf /etc/nginx/conf.d/default.conf EXPOSE 80 CMD ["nginx", "-g", "daemon off;"]