Deployment¶
The deployment of ReSQ is in the UWA Infrastructure (to be precise in the UWA System Health Lab). The reason being is that permission is granted to Frinze Erin Lapuz (Software Team Lead of the Redbacks Team at the UWA System Health Lab).
There a couple of steps that were involved in doing this:
DNS Configuration¶
This is a 1 time configuration
The domain name is set to "resq.systemhealthlab.com" in UWA Cloudflare.
NGINX Configuration¶
Using Binchicken, I have created the NGINX configuration that will handle all requests going to the application (reverse-proxy).
Nginx Configuration
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 | |
Diagrammatic Explanation¶
Deployment with Docker Image¶
This requires access towards the application inside the VPS. The easiest way to do this is to have access with the VPS through SSH (you may need permission for this).
Once you are in there, do
1 | |
main branch.
git pull
This assumes that you already have the repository in the VPS. If it does not exist, just do git clone.
Then run
1 | |
Gunicorn Process in Production¶
The reason as to why we gunicorn process instead of flask run in production is for the main following reason:
- gunicorn allows parallelising of HTTP request
- automatic disconnect towards the database after the short-lived process (of responding to HTTP request)
More information about its setup here.