Skip to content
gohacks.dev
DevOps

docker-compose.yml Generator

Generate a compose.yaml for local development with MySQL, PostgreSQL, Redis, Mailpit, Meilisearch, MinIO, RabbitMQ or Adminer, with healthchecks and volumes.

Free · No sign-up · Your inputs stay in your browser

Input

Generate a docker-compose.yml for local development

Output

compose.yaml

1,063 characters

Every port is published on 127.0.0.1 only: Docker writes its own iptables rules, so a plain 3306:3306 is reachable from the internet on a server even with ufw denying it. depends_on with condition: service_healthy waits for the healthcheck, not just for the container to start. Pin the latest tags before sharing the file.

Runs in this browser. Nothing you paste is sent to a server.

Publish on localhost

Docker inserts its own iptables rules for published ports, ahead of ufw's, so 3306:3306 on a server is reachable from the internet even with the firewall denying it. Binding to 127.0.0.1:3306:3306 keeps a database private. The packet filtering documentation explains the interaction.

Healthchecks and start order

depends_on alone only waits for a container to start, and a database accepts connections seconds later. With a healthcheck and condition: service_healthy, the app waits until the database answers, which removes the retry loop most entrypoint scripts carry.

Share

Frequently asked questions

Is the version key needed in a Compose file?
No. The Compose Specification has no version key; Docker Compose v2 ignores it and prints a warning, so leave it out.
Where does Compose store the database data?
In the named volumes declared at the bottom. docker compose down keeps them; docker compose down -v deletes them.
Is what I paste sent anywhere?
No. The tool runs entirely in your browser with JavaScript. Nothing you type or paste is sent to our server or stored.

Keep planning

Similar tools