-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathsystemd.service
25 lines (21 loc) · 1.13 KB
/
systemd.service
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
[Unit]
Description = A Gunicorn Webserver for {{ hostname }}.
After = network.target
[Service]
User = www-data
Group = www-data
WorkingDirectory = /srv/www/{{ hostname }}
EnvironmentFile = /srv/www/{{ hostname }}/.env
TimeoutSec = 1200
ExecStartPre = +/srv/www/{{ hostname }}/.venv/bin/manage.py migrate --noinput
ExecStartPre = +/srv/www/{{ hostname }}/.venv/bin/manage.py collectstatic --noinput
ExecStartPre = /srv/www/{{ hostname }}/.venv/bin/manage.py add_institutions --from-file /srv/www/{{ hostname }}/initial/institutions.json
ExecStartPre = /srv/www/{{ hostname }}/.venv/bin/manage.py add_users --from-file /srv/www/{{ hostname }}/initial/users.json
ExecStartPre = /srv/www/{{ hostname }}/.venv/bin/manage.py add_datasets --from-file /srv/www/{{ hostname }}/initial/datasets.json
ExecStartPre = /srv/www/{{ hostname }}/.venv/bin/manage.py add_riskmodels --from-file /srv/www/{{ hostname }}/initial/riskmodels.json
ExecStart = /srv/www/{{ hostname }}/.venv/bin/python -m gunicorn -c /srv/www/{{ hostname }}/gunicorn.conf.py
ExecReload = kill -s HUP $MAINPID
ExecStop = kill -s TERM $MAINPID
PrivateTmp = true
[Install]
WantedBy = multi-user.target