Compose replaces shell scripts that string together docker run commands
A four-service local stack — API, web, Postgres, Redis — with all the right networks, volumes, env vars, and start order takes about 8 lines of bash and is a nightmare to maintain. Compose puts the same stack in a YAML file and brings it up with docker compose up -d.
What Compose buys you
- Declarative — the file is the truth, not your shell history.
- Networks created for free — every service joins the project's default network with name-based DNS.
- One command for up, down, logs, exec, scale.
- Override files for dev vs prod without copy-paste.