Docker Compose: the application model and compose.yaml
Answer: Compose lets you define and manage multi-container apps in one YAML file. (S2) In the Compose Specification, a service is an abstract concept implemented on platforms by running the same container image, and configuration, one or more times. (S1)
Building blocks
- In the Compose Specification, a network is a platform capability abstraction to establish an IP route between containers within services connected together. (S1)
- The Specification describes persistent data as a high-level filesystem mount with global options. (S1)
- From inside the container, configs behave like volumes: they're mounted as files. (S1)
The Compose file
- The default path for a Compose file is compose.yaml (preferred) or compose.yml that is placed in the working directory. (S1)
- Compose also supports docker-compose.yaml and docker-compose.yml for backwards compatibility of earlier versions. (S1)
- If both files exist, Compose prefers the canonical compose.yaml. (S1)
- Compose offers a way for you to set a custom project name, so that the same compose.yaml file can be deployed twice on the same infrastructure by passing a distinct name. (S1)
Day-to-day benefits
- Compose caches the configuration used to create a container. When you restart a service that has not changed, Compose reuses the existing containers. (S2)
- Compose supports variables in the Compose file, which you can use to customize your composition for different environments, or different users. (S2)
Claims
- id: C1 claim: A Compose service runs the same image and configuration one or more times. source: S1 evidence: "and configuration, one or more times."
- id: C2 claim: compose.yaml is the preferred default Compose file. source: S1 evidence: "If both files exist, Compose prefers the canonical compose.yaml."
- id: C3 claim: Compose reuses existing containers for unchanged services. source: S2 evidence: "When you restart a service that has not changed, Compose reuses the existing containers."
- id: C4 claim: Compose supports variables in the Compose file. source: S2 evidence: "Compose supports variables in the Compose file."
Sources
- [S1] How Compose works. Docker Docs. https://docs.docker.com/compose/intro/compose-application-model/ . License: Docker docs, Apache-2.0 (github.com/docker/docs; https://github.com/docker/docs/blob/main/LICENSE); Docker name and logo are trademarks of Docker Inc and are not licensed. Accessed 2026-11-04.
- [S2] Why use Compose?. Docker Docs. https://docs.docker.com/compose/intro/features-uses/ . License: Docker docs, Apache-2.0 (github.com/docker/docs; https://github.com/docker/docs/blob/main/LICENSE); Docker name and logo are trademarks of Docker Inc and are not licensed. Accessed 2026-11-04.
License: this note is CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Summary by iinventedlight (AI-assisted).
License: CC-BY-4.0 · Summary by iinventedlight (AI-assisted). Sources: Docker Docs, How Compose works, Docker docs, Apache-2.0 (github.com/docker/docs; https://github.com/docker/docs/blob/main/LICENSE); Docker name and logo are trademarks of Docker Inc and are not licensed; Docker Docs, Why use Compose?, Docker docs, Apache-2.0 (github.com/docker/docs; https://github.com/docker/docs/blob/main/LICENSE); Docker name and logo are trademarks of Docker Inc and are not licensed.
Cite this
iinventedlight. 2026. "Docker Compose: the application model and compose.yaml." iinventedlight Library, iil:note:w47j684d, version of 2026-11-04. https://iinventedlight.com/library/notes/docker-compose-basics/. License: CC-BY-4.0.
@misc{iil_note_w47j684d,
author = {{iinventedlight}},
title = {{Docker Compose: the application model and compose.yaml}},
howpublished = {iinventedlight Library},
year = {2026},
date = {2026-11-04},
url = {https://iinventedlight.com/library/notes/docker-compose-basics/},
note = {Permanent ID iil:note:w47j684d. License: CC-BY-4.0.},
}
Spotted a mistake? Use the MCP feedback tool or email hello@iinventedlight.com.
For language models and agents: start at /llms.txt. This page in Markdown: /library/notes/docker-compose-basics.md.