What is Docker Compose?

πŸ”Ή The Problem

Normally, when you use docker run, you start one container manually β€” for example:

docker run -d -p 5432:5432 postgres
docker run -d -p 3000:3000 my-backend

That’s fine for testing,

but real-world apps have multiple containers β€”

backend, database, redis, frontend, etc.

Manually running each with docker run, linking networks, passing environment variables, etc., becomes messy and hard to manage.


πŸ”Ή The Solution β†’ Docker Compose

Docker Compose is a tool that lets you:

So you can do:

docker compose up

and Docker will: