Put Your Docker Compose File Together

Add a service, fill in what it needs, and the YAML on the right rewrites itself as you type. Start from a preset for a stack you recognise and change what differs.

Start from a preset

Output follows the Compose Specification (no version: key, it is ignored by current Docker). Works with docker compose up.

Project options

How the Generated Compose File Is Put Together

Every service you add becomes one block under services:, written in the order you added them. Named volumes are collected from the volume fields and declared once under a top-level volumes: key, which is the part most hand-written files forget; a bind mount (anything containing a slash) stays inline. When the network option is on, every service joins one named bridge network and the network is declared at the bottom.

depends_on is written in the long form when the target service has a healthcheck, so the dependent waits for condition: service_healthy instead of just "started". A database that answers on its port but is still initialising is the classic first-run failure, and this is the fix for it. Healthchecks are guessed from the image: pg_isready for Postgres, mysqladmin ping for MySQL and MariaDB, redis-cli ping for Redis, mongosh for Mongo, and a curl or wget against the first container port for anything that serves HTTP.

Before you run it

Save the file as docker-compose.yml (or compose.yaml, both are read) in the folder that holds your Dockerfile and source, then run docker compose up -d. Ports are written host first, container second; a host port that is already taken fails with "port is already allocated", so change the left number, not the right one. Passwords in the environment section are fine for a laptop and wrong for a server: tick the .env option and the file references variables instead. The guide covers the first-run checklist, and the validator explains any Compose file you paste into it, including this one.