Skip to content
Toolsmith

Next.js Dockerfile generator

Generate a production multi-stage Dockerfile for Next.js, plus .dockerignore and compose.

In Package manager, Node version, base image, standalone, Prisma, healthcheck, port, and build-time env names./Out Dockerfile, .dockerignore, docker-compose.yml, a next.config snippet, and build commands. A zip of the files.

How to use it

  1. 1Pick a package manager and Node versionChoose npm, pnpm, yarn, or bun, then Node 20, 22, or 24 on Alpine or Debian slim.
  2. 2Toggle standalone, Prisma, and the healthcheckStandalone is on by default. Prisma adds prisma generate. The healthcheck calls a route with node fetch, so the image does not need curl.
  3. 3Copy the files and run docker buildDownload the Dockerfile, ignore file, and compose file, set output standalone in next.config, then build and run.

Questions

Related

Search tools

Jump to an instrument