Docker Compose Production-like Stack
Assemble a realistic local environment — Postgres, Redis, RabbitMQ and an app — with health checks, dependency ordering and env config, one service at a time.
Real systems are never one process. Here we build a production-like local stack with docker-compose — Postgres, Redis, RabbitMQ and an app — adding one service or one piece of wiring per step. The focus is the unglamorous glue that makes a stack reliable: health checks, dependency ordering that waits for readiness, centralized config and restart policy. By the end one command brings the whole environment up in the right order.
What you'll build
- Compose Postgres, Redis, RabbitMQ and an app together
- Add health checks so readiness is observable
- Order startup with dependency conditions
- Centralize configuration in an env file
- Make services restart on failure
Contents
- What we're assembling
- The database
- Is Postgres actually ready?
- The cache
- The message broker
- Pull config out into a file
- Use the config
- The app
- Start in the right order
- Recover from a crash
- A readiness gate for scripts
- Bring the stack up