Skip to content
Snippets Groups Projects
Dockerfile 556 B
Newer Older
  • Learn to ignore specific revisions
  • # Stage 0, "build-stage", based on Node.js, to build and compile the frontend
    FROM node:14-alpine as build-stage
    
    Guilhem CARRON's avatar
    Guilhem CARRON committed
    
    WORKDIR /app
    
    COPY package.json /app/
    COPY yarn.lock /app/
    RUN yarn install
    
    RUN yarn build
    
    
    # Stage 1, based on Nginx, to have only the compiled app, ready for production with Nginx
    
    FROM nginxinc/nginx-unprivileged:1.23
    
    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 8080
    
    CMD ["nginx", "-g", "daemon off;"]