Docker Compose
ELI5 — The Vibe Check
Docker Compose is a tool for running multiple containers together as a team. Your app needs a web server, a database, and a cache? Instead of manually starting 3 containers, you write one docker-compose.yml file that describes all three, and one command (docker compose up) starts everything at once.
Real Talk
Docker Compose is a tool for defining and running multi-container Docker applications using a YAML file. It manages the networking, volumes, environment variables, and startup order of multiple services. Widely used for local development environments to mimic production service topologies.
Show Me The Code
# docker-compose.yml
services:
app:
build: .
ports: ["3000:3000"]
depends_on: [db]
environment:
DATABASE_URL: postgres://user:pass@db/mydb
db:
image: postgres:16
volumes:
- db-data:/var/lib/postgresql/data
volumes:
db-data:
When You'll Hear This
"Use Docker Compose to run the full stack locally." / "docker compose up starts the app, database, and Redis all together."
Related Terms
Container
A container is a running instance of a Docker image — it's the lunchbox you made and actually opened to eat from.
Docker
Docker is like a lunchbox for your app.
Image
A Docker image is the blueprint or template for a container. It's like a frozen snapshot of your app and everything it needs to run.
Kubernetes
Kubernetes is a robot manager for your containers.
Volume
A Volume is persistent storage attached to a container — because containers themselves are like tents: when you take them down, everything inside is gone.