What I created is a very flexible -for my needs- Docker Compose setup. It is suited for development, and is adaptable to be production ready, although that is a task that needs to be done on a per project basis.
Out of the box you get the following docker images:
- Caddy as a web server for easy https (includes Cloudflare plugin)
- Postgres as the database
- An image to run Django
- An development email server to make the email testing process easy
The Django image
The Django image is based on Alpine, and uses multi-stage builds to make compiling python packages easy. This is useful for packages like Pillow and Psycopg2 that do not have precompiled wheels for Alpine. Those packages will only be compiled if your app depends on them.
The Caddy image
Caddy is by far the easiest web server I have worked with. It is easy to install, easy to configure and easy to run. But by far its best feature is how easy it is to deal with https, thanks to its integration with LetsEncrypt.
I use CloudFlare for any domain if I can, and I develop with real domains using https (no
localhost for my projects), Caddy makes this painless.
All this made easy by Cookiecutter, my favourite project template manager which allows for some initial setup automatic configuration.
But I wont give away any more here go test the template.