📦Docker Compose
Also known as compose.yaml, docker-compose.yml, docker compose up
A tool that starts a group of containers. One file and one command do it.
Think of it like
It is like a song sheet for a band. One sheet tells every player when to start.
Example
Emma's app needs a web server, a database and a cache. Her file lists all three. A new teammate starts the whole thing with one command.
Why it matters
The whole setup lives in one file, so anyone can start it the same way.
Definition
Example code
yaml
services:
web:
image: nginx
ports:
- "8080:80"
cache:
image: redisCommon mistake
Key takeaways
- 1One file. Every container is listed in compose.yaml.
- 2One command. Up starts them all, down removes them.
- 3Shared network. Services reach each other by name.