https://github.com/bbachi/nextjs-nginx-docker
https://github.com/bbachi/nextjs-nginx-docker/blob/main/Dockerfile
# stage1 as builder FROM node:10-alpine as builder # copy the package.json to install dependencies COPY package.json package-lock.json ./ # Install the dependencies and make the folder RUN npm install && mkdir /nextjs-ui && mv ./node_modules ./nextjs-ui WORKDIR /nextjs-ui COPY . . # Build the project and copy the files RUN npm run build FROM nginx:alpine #!/bin/sh COPY ./.nginx/nginx.conf /etc/nginx/nginx.conf ## Remove default nginx index page RUN rm -rf /usr/share/nginx/html/* # Copy from the stahg 1 COPY --from=builder /nextjs-ui/out /usr/share/nginx/html EXPOSE 3000 80 ENTRYPOINT ["nginx", "-g", "daemon off;"]
https://github.com/bbachi/nextjs-nginx-docker/blob/main/.nginx/nginx.conf
worker_processes 4; events { worker_connections 1024; } http { server { listen 80; root /usr/share/nginx/html; include /etc/nginx/mime.types; location /appui { try_files $uri /index.html; } } }
Wondering if there's anything that can make it faster.