This sample repo shows, how to deploy a nextjs app using docker.
Execute create-next-app
with npm, to bootstrap the example:
npx create-next-app --example with-docker nextjs-docker
- Install Docker on your machine.
- Build your container:
docker build -t nextjs-docker .
. - Run your container:
docker run -p 3000:3000 nextjs-docker
.
You can view your images created with docker images
.
Open http://localhost:3000 with your browser to see the result.