How to use the docker compose generator
- Choose a template and click Add Service. Add as many as your stack needs.
- Open a service to change its image, ports, volumes and environment variables. Put one item on each line.
- Click Copy or Download, save the file as
docker-compose.ymland rundocker 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.
| Key | What it does | Example |
|---|---|---|
image | The image and tag to run | postgres:17 |
ports | Publishes a container port on the host, as host:container | 8080:80 |
volumes | Keeps data outside the container, as source:path | db_data:/var/lib/postgresql/data |
environment | Settings passed to the container | POSTGRES_PASSWORD=secret |
depends_on | Starts other services first | db |
restart | What to do when the container stops | unless-stopped |
Good habits
- Pin image versions.
postgres:17is safer thanpostgres: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.envfile 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
portsentry 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.