Compose file
The YAML file, usually compose.yaml, that lists the services, networks and volumes of an application.
In more detail
Each entry under services says which image to run or build, which ports to publish, which environment variables and volumes to use, and what it depends on. Keep secrets out of it; reference secret files or environment files instead.
Example
services:
api:
build: .
ports: ["18080:8000"]Related terms
- Docker Compose — A Docker tool that starts several related containers together from one YAML file.
- 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.
- YAML — A human-friendly text format for configuration, where indentation shows structure.
- Compose override file — A second Compose file whose settings are merged on top of the main one, typically for development.
Taught in
- 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
- Harden And Deliver The Complete Service Stack — Docker Architecture & Production Containers
- From Local Containers To Kubernetes — Docker Architecture & Production Containers