Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
Feature/Add Azure deployment automation #72
Currently the application can easily be deployed to Heroku via the Procfile. This change adds an ARM template to additionally easily deploy the application to Azure.
To make management of the application as straight forward as possible, the ARM template leverages PaaS solutions: the Django application is deployed via the Docker container to a Web App for Containers and the app's data storage is a managed PostgreSQL instance.
For additional security, the PostgreSQL database is configured to only allow connections from other Azure IPs. If someone wishes to connect to the database manually, e.g. via pgadmin, the client's IP must be white-listed in the database server's firewall (instructions).
Given that the resources are deployed asynchronously by ARM, sometimes the web app may be provisioned before the database is set up or before the database server's firewall is correctly set up. To prevent race conditions, this change includes a Django management script that makes the application wait until the database is available before starting up. This script will also be useful in other contexts such as using an external database linked to the application in docker-compose or kubernetes.