Docker Compose
Docker Compose describes an application made of several containers (services) in a compose.yaml file and manages the whole stack with docker compose up and docker compose down.
Key concepts #
- Services: the containers, built from a Dockerfile (
build:) or pulled (image:). - Networks: Compose creates one for the project, and services reach each other by service name.
- Volumes: named volumes keep data such as a database between runs.
- Healthchecks and
depends_oncontrol the start order. - Profiles make services optional, and Compose Watch syncs code into running containers.