This will complicate things a little, but is a nice to have.
Thoughts?
Do it!
@jayfk, how is this going? Can I be of any help?
I'd love to see this too.
Djangopackages has it:
https://github.com/djangopackages/djangopackages/blob/master/docker-compose.yml#L9-L35
https://github.com/djangopackages/djangopackages/blob/master/fabfile.py
https://github.com/djangopackages/djangopackages/blob/master/compose/caddy/Caddyfile#L6-L15
The main idea is to have two running Django containers that are load balanced by the webserver.
If someone wants to work on this, I'd be happy to review it.
Wondering what should we do if there's a new db migration in code pushed?
You create a database migration first thats both compatible with the new and the old code and deploy it. Once that鈥榮 complete, you deploy code changes to use the migrated scheme and finally you add a second migration that removes the old one.
@browniebroke @jayfk @pydanny I'm not too acquainted with Traefik, but since we've moved on from caddy, here's something that could be useful if we keep trying Blue/Green deployment: https://www.katacoda.com/courses/distributed-microservices/3-blue-green-routing
Blue/Green deployment would work for non-async views (so no Channels or Django 3 web sockets, unless I read that README.md wrong) unless that load balancing configuration works by slowly moving traffic instead of immediate. Then again, I have no idea how it works and was wondering if this PR could be continued in development by someone who did know? Or should I create a new issue to track this so other GH users can see it more visibly?
Most helpful comment
You create a database migration first thats both compatible with the new and the old code and deploy it. Once that鈥榮 complete, you deploy code changes to use the migrated scheme and finally you add a second migration that removes the old one.