Changes:
- Switch to Python 3.10
- Drop pywheels.org repository. Build cryptography, uwsgi, psycopg2
etc. from source. This means builds on armhf will be slower, but
hopefully fewer worries about the piwheels binary package
not finding a .so file in our base image
- Don't ship the .git folder (facepalm)
The binary uwsgi package from piwheels.org crashes with:
uwsgi: error while loading shared libraries: libxml2.so.2:
cannot open shared object file: No such file or directory
(when run in a docker environment, with python:3.9-slim-buster
base image. It works fine in Raspbian)
The workaround is to build uwsgi from source, hence the "--no-binary"
flag.
The problem:
- the first "pip wheel" collects a specific version of requests
- the second "pip wheel" collects the latest version of requests
- later "pip install" tries to install both and fails
The fix is to run "pip wheel" once, and it will then pick a single
version of requests that satisfies all constraints.
Fixes: #594
Fixes: #565
Also, split Dockerfile into two stages, so rust
and other build dependencies don't end up in the final image.
Note cryptography has binary wheels for various architectures,
but unfortunately not for 32-bit arm. And, starting from v35.0.0,
cryptography requires rust to build from source.