Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/bjarneo/nextjs-dockerfile
A generic dockerfile for Next.js
https://github.com/bjarneo/nextjs-dockerfile
Last synced: 3 days ago
JSON representation
A generic dockerfile for Next.js
- Host: GitHub
- URL: https://github.com/bjarneo/nextjs-dockerfile
- Owner: bjarneo
- License: mit
- Created: 2024-08-22T06:11:55.000Z (3 months ago)
- Default Branch: main
- Last Pushed: 2024-08-23T07:19:20.000Z (3 months ago)
- Last Synced: 2024-08-23T08:34:27.195Z (3 months ago)
- Language: Dockerfile
- Size: 5.86 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
## Recommendation
Follow the docker image setup provided by the official docs: https://nextjs.org/docs/app/building-your-application/deploying#docker-image. Remember to add this for the standalone version: https://nextjs.org/docs/app/api-reference/next-config-js/output#automatically-copying-traced-files# Next.js Dockerfile
Copy the `Dockerfile` to the root of your project.## Note
This dockerfile is generic and would work for most of the next.js applications out there.## Build and run locally
```bash
docker build -t .docker run -it -p 3000:3000 --rm --name
# Need to inject .env file?
# Add this to the run command:
# -v /host/path/.env:/app/.env
docker run -it -p 3000:3000 -v /host/path/.env:/app/.env --rm --name
```## Improvements
Most likely the file can be improved even more. Feel free to add a PR.