Skip to content

smgn/next-js-docker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

next.js docker

next-js-docker

A docker configuration for next.js project. Use this template to build a docker image for the next.js application.

About the Container

harden.sh and some other ideas are taken from [alpine-harden]https://github.com/ellerbrock/docker-collection/tree/master/dockerfiles/alpine-harden repo.

As Base Image i use An official node alpine image which is lightweight Distribution with a smaller surface area for security concerns, but with enough functionality for development and interactive debugging.

To prevent zombie reaping processes i run dumb-init as PID 1 which forwards signals to all processes running in the container.

I keep image size lower by following the Docker's recommendations:

  1. .dockerignore is setup to ignore everything but files needed in production. Please add files/directories specific to your application there.
  2. The build is multi-stage, so the final image doesn't have python and other packages installed.
  3. RUN statements contain multiple commands which reduces the number of layers.

About

A docker configuration for next.js project

Topics

Resources

License

Stars

Watchers

Forks