Nice one!
Consider a follow up article with 1. Alpine Linux as the base image to significantly reduce the size and 2. Build the requirements in one layer, and then transfer the codebase to a new layer to further reduce size.
First of all, I would rather use docker-compose, not a single docker build, since your app can grow. Speaking of growing, I would separate dev & prod docker-compose.<p>> When we develop more than one python project, we need to configure our development environment with the dependencies of all the projects.<p>use pyenv and simple virtualenvs.<p>I think you are trying to substitute a virtualenvs with a docker. Why trying to kill a sparrow with a cannon?
while i agree this is overly complex given the simplicity of virtualenvs, there is something “pythonic” about encapsulating the environment in a container.<p>I would suggest using alpine containers with python for a ~40mB container, versus the ~900MB container created here to run a server.<p>For me, python containers are only used when I want to bundle things into services on swarm, and I use venvs for local development.