Newer
Older
# Stage 0, "build-stage", based on Node.js, to build and compile the frontend
COPY package.json /app/
COPY yarn.lock /app/
RUN yarn install
# Stage 1, based on Nginx, to have only the compiled app, ready for production with Nginx
FROM nginxinc/nginx-unprivileged:1.25
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
CMD ["nginx", "-g", "daemon off;"]