Instead of running multiple containers…
…declare a whole stack of services
Services are described in a declarative manner
Modifications are applied incrementally
Service discovery is builtin
Based on independent compose specification
–
WordPress requires a database, e.g. MySQL
docker-compose.yaml
defines both services:
services:
db:
image: mysql:5
web:
image: wordpress:5.4
Both services need matching database configuration provided by environment variables
Deploy using docker-compose
:
docker-compose up
Remove deployment:
docker-compose down
–
Both flavours shipped with Docker Desktop
Implemented in Python
Install using pip: pip install docker-compose
Install standalone binary from GitHub releases
Usage: docker-compose
Implemented in Go
Install and update using install script
Usage: docker compose