Docker Compose generator

Pick services from the templates, adjust the ports, volumes and environment variables, and get a tidy docker-compose.yml you can copy or download.

docker-compose.yml

How to use the docker compose generator

  1. Choose a template and click Add Service. Add as many as your stack needs.
  2. Open a service to change its image, ports, volumes and environment variables. Put one item on each line.
  3. Click Copy or Download, save the file as docker-compose.yml and run docker compose up -d.

What goes in a Compose file

A Compose file describes a set of containers that run together. Each entry under services is one container, with the image to use and how it connects to the outside world.

KeyWhat it doesExample
imageThe image and tag to runpostgres:17
portsPublishes a container port on the host, as host:container8080:80
volumesKeeps data outside the container, as source:pathdb_data:/var/lib/postgresql/data
environmentSettings passed to the containerPOSTGRES_PASSWORD=secret
depends_onStarts other services firstdb
restartWhat to do when the container stopsunless-stopped

Good habits

  • Pin image versions. postgres:17 is safer than postgres:latest, which can jump a major version on the next pull.
  • Keep secrets out of the file. Write ${DB_PASSWORD} in the Compose file and put the real value in a .env file beside it. The .env editor helps with that.
  • Only publish the ports you need. Containers on the same Compose network reach each other by service name, so a database usually needs no ports entry at all.
  • Use named volumes for data. A volume name with no slash, such as db_data, is declared for you at the bottom of the file.

Useful commands

docker compose up -d        # start everything in the background
docker compose ps           # list the containers
docker compose logs -f web  # follow the logs of one service
docker compose pull && docker compose up -d   # update images
docker compose down         # stop and remove the containers

The file follows the current Compose Specification, so there is no version: line. Check the result with the YAML validator, or put a reverse proxy in front with the Nginx config generator.

Private by design

This tool runs entirely in your web browser. Nothing you type or paste is sent to a server, logged or stored, so it is safe to use with internal addresses, configuration files and other work data. There is no sign-up and it keeps working offline once the page has loaded.

Frequently asked questions

Do I still need the version line in docker-compose.yml?

No. Docker Compose v2 ignores it and the Compose Specification marks it as obsolete, so this generator leaves it out.

Should the file be called docker-compose.yml or compose.yaml?

Both work. Docker looks for compose.yaml first and still accepts docker-compose.yml.

How do containers talk to each other?

By service name. If the services are called web and db, the web container reaches the database at the host name db.

Where should I put passwords?

In a .env file next to the Compose file, referenced as ${NAME}. Do not commit that file to Git.