tox-tests: add PostgreSQL support
Update the tox test runner to also spin up a PostgreSQL service and pass
credentials to the tox container. To facilitate testing Django apps, the
credentials are passed both in DJANGO_DB_...
environment variables and
in POSTGRES_...
environment variables.
To better match our standard project layout, also load environment variables from compose/base.env if it is present.
You can see this in action in https://gitlab.developers.cam.ac.uk/uis/devops/research-dashboard/webapp/pipelines/700
Edited by Dr Rich Wareham