Dockerfile Generator
Create a secure multi-stage Dockerfile with a non-root user, plus a .dockerignore, for Node.js, Python, Go, or a static site.
The Dockerfile uses a multi-stage build, a non-root user, and CMD in exec form. Check the versions and paths against your project before you use it.
How to Use It
- Choose the stack.
- Type the version, the port, and the commands.
- Copy or download the Dockerfile and the .dockerignore.
Questions and Answers
Why is CMD an array?
The exec form runs the program directly, without a shell. So the stop signal (SIGTERM) reaches the program, and the container stops cleanly.
Good to Know
The templates fit common projects: Node with npm, Python with requirements.txt, Go with go.mod, and a static site built with npm. The tool does not read your project or build an image.
Source code of this tool (opens in a new tab)Report a problem on GitHub (opens in a new tab)