Docker Compose
A Docker tool that starts several related containers together from one YAML file.
In more detail
Instead of typing long docker run commands for a service, its database and a network, you describe them once in compose.yaml and run docker compose up. Compose creates the networks and volumes, starts services in dependency order and lets you tear everything down with docker compose down. It ships with Docker Desktop and as the docker-compose-plugin package on Linux.
Examples
docker compose up -ddocker compose versiondocker compose ps --format '{{.Service}} {{.Status}}' lists grafana, loki, otel-collector, prometheus and service.Related terms
- Compose file — The YAML file, usually compose.yaml, that lists the services, networks and volumes of an application.
- service — A long-running program that waits for and answers requests, such as a web API or a database; in Compose, one named entry under services.
- depends_on — A Compose setting that makes one service start only after the services it needs.
- docker compose down — Stops and removes the containers and networks a Compose project created.
- YAML — A human-friendly text format for configuration, where indentation shows structure.
- container — A running program that has been fenced off from the rest of the computer so it only sees its own files, network and processes.
Taught in
- Install Docker And Verify Your Environment — Docker Architecture & Production Containers
- Run, Stop, Restart And Remove A Container — Docker Architecture & Production Containers
- Bind Mounts, Permissions And Backups — Docker Architecture & Production Containers
- Bridge Networks, DNS And Container Communication — Docker Architecture & Production Containers
- Port Publishing, Localhost And Network Troubleshooting — Docker Architecture & Production Containers
- Environment, Secret Files And Runtime Restrictions — Docker Architecture & Production Containers
- Define The Service And Database With Compose — Docker Architecture & Production Containers
- Health Checks, Dependencies And Reliable Startup — Docker Architecture & Production Containers
- Development Overrides, Hot Reloading And Debuggers — Docker Architecture & Production Containers
- Integration Tests, Test Data And Compose Cleanup — Docker Architecture & Production Containers
- Diagnose Crashes, Resource Limits And Unhealthy Containers — Docker Architecture & Production Containers
- Harden And Deliver The Complete Service Stack — Docker Architecture & Production Containers
- From Local Containers To Kubernetes — Docker Architecture & Production Containers
- Prometheus Scraping And The Pull Model — Full-Stack Observability: Metrics, Tracing & Logging
- Grafana: Connecting The Data Source — Full-Stack Observability: Metrics, Tracing & Logging