Skip to main content
HandyWeb

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.

Stack

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

  1. Choose the stack.
  2. Type the version, the port, and the commands.
  3. 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)