Why: test.unglue.it costs ~$88/month (EC2 + RDS) running 24/7. Local Docker would enable testing PRs without spinning up AWS infrastructure.
Requirements
- Django 1.11.29 + Python 3.8
- MySQL 8.0
- Redis (for Celery, optional for basic testing)
- Load production DB snapshot for realistic testing
- Run
manage.py test locally
- Browse the site at localhost
Approach
Dockerfile based on Python 3.8
docker-compose.yml with app + MySQL + Redis services
- Docker-specific settings file (like doab-check's
settings/docker.py)
- Script to load a production DB dump for realistic data
- Port 8000 or configurable
Prior art
doab-check is already dockerized (~/C/src/doab-check) with the same pattern:
- Dockerfile, docker-compose.yml, settings/docker.py
- Full production DB loaded via pg_dump
- Running at localhost:8001
Complexity notes
- Django 1.11 is old but Docker doesn't care — just pin Python 3.8
- MySQL instead of PostgreSQL (doab-check uses Postgres)
- Celery/Redis optional — most testing doesn't need background tasks
settings/keys/ needs dummy values for local dev
- Static files need
collectstatic
Related
Why: test.unglue.it costs ~$88/month (EC2 + RDS) running 24/7. Local Docker would enable testing PRs without spinning up AWS infrastructure.
Requirements
manage.py testlocallyApproach
Dockerfilebased on Python 3.8docker-compose.ymlwith app + MySQL + Redis servicessettings/docker.py)Prior art
doab-check is already dockerized (~/C/src/doab-check) with the same pattern:
Complexity notes
settings/keys/needs dummy values for local devcollectstaticRelated