Docker Compose generator

Tick the services your project needs and get a docker-compose.yml with ports, named volumes, environment variables and optional health checks. The image tags are examples: check Docker Hub for the versions you want before using the file.

Publish database ports

A starting point. Check the image versions on Docker Hub, replace the change-me passwords (for example in a .env file next to this file), and provide an nginx.conf if you add Nginx. Run it with docker compose up -d.

Runs in your browser: nothing you enter is sent anywhere.

How to use it

  1. Select the services you need. The Node app builds from a Dockerfile in the same folder (see the Dockerfile generator).
  2. Decide whether database ports are published to your machine, and pick a restart policy.
  3. Copy the result into docker-compose.yml and start it with docker compose up -d.

What is generated

  • The app gets connection strings for the selected databases, using the service names as host names.
  • Databases get named volumes so data survives docker compose down (it is removed only with -v).
  • Nginx mounts ./nginx.conf read-only and depends on the app.

Example

With the defaults, you get an app on port 3000, PostgreSQL and Redis, each with a health check and a volume, and the app waiting for both to be healthy.

Tips

  • Keep secrets in .env and out of version control.
  • Inside Compose, use the service name (postgres, redis) as the host, not localhost.

Frequently asked questions

Is the image version current?

Not necessarily. The tags (postgres:17, mysql:8.4, redis:7-alpine, mongo:8, nginx:1.27-alpine) are examples of widely used ones. Check Docker Hub and edit the file; pin a specific version for repeatable deployments.

Why is there no version: line?

The Compose Specification treats the top-level version key as obsolete, and current Docker Compose ignores it with a warning. The generated file starts directly with services.

How do I change the passwords?

The passwords are written as ${POSTGRES_PASSWORD:-change-me}. Compose replaces them with the value from your shell or a .env file in the same folder, and falls back to change-me. Always set real values outside development.

What does "Local only" mean for database ports?

The port is published as 127.0.0.1:5432:5432, so only the machine itself can connect. Other containers reach the database by service name without any published port, so "No" is the safest choice when you do not need host access.

What do the health checks do?

Each database gets a healthcheck command. The app then uses depends_on with condition: service_healthy, so it starts only after the databases accept connections.

More in Developer

All tools in this category: Developer ·Updated November 3, 2026

Privacy choices

Google Analytics shows us which tools are used and whether they work. It may set cookies. Your choice is kept in this browser.