```yml
app:
build: . # image to build
depends_on: # dependencies
- db
environment: # configuration
DB_URL: postgres://db:5432/app
ports: # port mapping
- '8080:80'
restart: always # restart policy
```
Services are backed by one or multiple **containers**.
**Notes:**
Services are defined in the **Compose file**. Service containers are run by the
platform according to specified requirements. All containers within a service
are identically created with these arguments. Each service can be scaled
independently.
---
## Why use Docker Compose?
- Simple **container orchestration**
- **Efficient collaboration**: compose files are easy to share
- **Portability** across environments through configuration
**Notes:**
- Orchestrate multi-container applications in a single file, making your
application environment easy to replicate.
- Compose files facilitate collaboration among developers, operations teams, and
other stakeholders.
- Compose supports variables to customize your containers for different
environments or users.
[docker]: https://www.docker.com
[yaml]: https://yaml.org