Django + Celery Stack
Django + Postgres + Redis + Celery + Flower + Mailhog — async tasks and email dev wired from the start.
Django + Celery Stack
A complete Django development environment with async task processing built in. Background jobs, scheduled tasks, email testing, and a database GUI all wired together and ready on first docker compose up.
What's Included
- Django 5 — Latest Django with DRF pre-installed,
settings.pyconfigured for all services - PostgreSQL 16 — Primary database with persistent volume and health check
- Redis 7 — Celery broker and Django cache backend
- Celery Worker — Processes async tasks from the same codebase, auto-reloads on code changes
- Celery Beat — Periodic task scheduler with Django DB scheduler backend
- Flower — Celery monitoring dashboard with task history and worker stats at port 5555
- Mailhog — Catches all outgoing Django email; inspect messages at port 8025
Developer Experience
- Source bind-mounted — Django auto-reloader works inside all containers simultaneously
- Migrations run automatically on startup; create superuser with a one-liner
- Pre-configured
settings.pysections for Celery, Redis cache, and email backend - Health checks on Postgres and Redis — app, worker, and beat all wait until ready
- Run management commands:
docker compose exec app python manage.py ... - Single
docker compose upstarts everything
What You Get
docker-compose.yml— fully configured multi-service stackDockerfile— Python 3.12 slim image with all requirements installedentrypoint.sh— waits for DB, runs migrations, collects static files on bootrequirements.txt— Django, DRF, Celery, Redis, Pillow, and dev tools.env.examplewith every variable documentedREADME.md— quickstart, service URLs, task examples, and admin setup
Service URLs
| Service | URL |
|---|---|
| Django App | http://localhost:8000 |
| Django Admin | http://localhost:8000/admin |
| Flower (Celery UI) | http://localhost:5555 |
| Mailhog (email inspector) | http://localhost:8025 |
Requirements
Docker Desktop or Docker Engine with the Compose plugin. No local Python, PostgreSQL, or Redis installation needed.