'It works on my machine' usually means someone has a different database version. Docker Compose defines your entire local stack in one file so every developer runs the exact same environment.
A Compose File With App + DB + Cache
services:
app:
build: .
ports: ["3000:3000"]
depends_on: [db, redis]
environment:
DATABASE_URL: postgres://dev:dev@db:5432/app
db:
image: postgres:16
environment:
POSTGRES_USER: dev
POSTGRES_PASSWORD: dev
POSTGRES_DB: app
volumes: ["pgdata:/var/lib/postgresql/data"]
redis:
image: redis:7
volumes:
pgdata:One Command to Rule Them All
docker compose up # start everything
docker compose down # stop and clean upOnboard in Minutes
A new hire clones the repo and runs one command — no manual Postgres/Redis installs. Commit the compose file and your onboarding doc shrinks to a single line.
