How to use
- Use the Add a service buttons to add your app, Nginx, PostgreSQL, MySQL, MariaDB, MongoDB, Redis or RabbitMQ as many times as you need. Adding the same kind again gets a numbered name so they do not clash.
- In each service card, edit the name, image tag, ports, environment, volumes and restart policy. For your own app, leave the image empty to build the current folder with
build. - Choose whether to use a dedicated network and healthchecks.
- Copy or download the generated
compose.yamland.env.exampleinto one folder, runcp .env.example .envand fill in the passwords, then start withdocker compose up -d.
Service presets
| Service | Default image | Data volume | Password variable |
|---|---|---|---|
| PostgreSQL | postgres:17 |
postgres-data:/var/lib/postgresql/data |
POSTGRES_PASSWORD |
| MySQL | mysql:8.4 |
mysql-data:/var/lib/mysql |
MYSQL_PASSWORD, MYSQL_ROOT_PASSWORD |
| MariaDB | mariadb:11 |
mariadb-data:/var/lib/mysql |
MARIADB_PASSWORD, MARIADB_ROOT_PASSWORD |
| MongoDB | mongo:8 |
mongo-data:/data/db |
MONGO_ROOT_PASSWORD |
| Redis | redis:7-alpine |
redis-data:/data |
none (port not published) |
| RabbitMQ | rabbitmq:4-management-alpine |
rabbitmq-data:/var/lib/rabbitmq |
RABBITMQ_PASSWORD |
| Nginx | nginx:stable-alpine |
mounts ./nginx.conf read-only |
none |
Change any image tag to the version you want. The tags are examples from when this page was written, so check that they exist on Docker Hub and are still supported.
What the output does
- Passwords are never written into the file. DB passwords appear only as references like
${POSTGRES_PASSWORD:?set POSTGRES_PASSWORD in .env}; if.envlacks the value,docker composestops before starting..env.examplelists the same variable names without values. - Databases do not publish host ports. App services on the same network reach them by service name (
postgres,redisand so on). If you must publish one, bind to localhost with something like127.0.0.1:5432:5432. - Start order: with healthchecks on, the app waits for
service_healthyon each database. PostgreSQL is checked withpg_isready, MySQL withmysqladmin pingand Redis withredis-cli ping. With them off, you get a plaindepends_onlist. - Named volumes are registered in the top-level
volumes:automatically; path binds such as./data:/dataare not. - If the PostgreSQL image is version 18 or newer, the data mount is changed to
/var/lib/postgresql. Version 17 and older use/var/lib/postgresql/data. - Port mappings are always double-quoted so YAML does not read
80:80as a base-60 number.
Things to know
- To write a literal
$in an environment value, type$$. Compose substitutes anything that starts with$as a variable. - A warning appears when a key containing PASSWORD, SECRET or TOKEN has a literal value. Even for local development, moving it to
.envkeeps the secret out of the repository. - Current compose files do not need a
version:key, so none is generated. - Review the generated files before using them in production. Resource limits, logging and backups are not included.
docker compose configshows the result after variable substitution. - Build your app image with the Dockerfile Generator and write the front proxy config with the Nginx Config Generator. The Env Converter converts
.envformats and the JSON YAML Converter helps inspect the YAML structure. To run something on a host without Docker, see the systemd Service Generator.
Frequently asked questions
Should I name the file docker-compose.yml or compose.yaml?
Docker Compose V2 looks for compose.yaml first and still reads docker-compose.yml. This tool downloads compose.yaml, the currently recommended name.
What if my app starts before the database even with depends_on?
Plain depends_on only waits for the container to start, not for the database to be ready. Turn on the healthcheck option and the app waits for condition: service_healthy.
Where is volume data stored?
Named volumes live in an area managed by Docker and survive docker compose down. docker compose down -v deletes them too, and the data is gone, so be careful.
Can I write passwords directly in compose.yaml?
It works, but the file ends up in your repository and backups. This tool generates variable references plus .env, and warns if you type a value directly.
Is my input sent to a server?
No. The files are generated entirely in your browser.
Your input is processed in this browser and never sent to a server.