Open pchote opened 6 years ago
There's some information about setting up a systemd service on the Gunicorn website:
http://docs.gunicorn.org/en/stable/deploy.html#systemd
Regarding virtualenvwrapper, I've found this much easier to use than trying a system wide install personally, as it allows you to have a specific version of python, django and any other dependencies set up for a directory. This means that there is much less risk of conflicting with anything system-wide. I can also see this being easier for upgrading / initial set up.
I've found when trying to install globally, there is a mine field of python versions, pip versions and environment variables, which virtualenvwrapper handles very cleanly and easily for you. I'm very new to python and django though.
Also the sample systemd config file looks like it should work with virtualenvwrapper, so I'd imagine it is possible to set up a systemd service either way.
Relying on a screen session (see INSTALL.md) is horrible. The resource center is now also running in a dedicated VM, so the virtualenvwrapper is unnecessary complexity.
https://github.com/warwick-one-metre/dashboard (dashboard.service, dashboard.ini) provides an example of how to run gunicorn through systemd, allowing it to automatically start on system boot, restart if it crashes, and generally be managed like any other service through
systemctl
.