File: //etc/systemd/system/gunicorn-cargochains.service
[Unit]
Description=Gunicorn CargoChains
After=network.target
[Service]
User=django
Group=www-data
WorkingDirectory=/home/django/apps/cargochains
Environment="DJANGO_SETTINGS_MODULE=config.settings_server"
Environment="PATH=/home/django/apps/cargochains/venv/bin"
RuntimeDirectory=gunicorn
ExecStart=/home/django/apps/cargochains/venv/bin/gunicorn \
--workers 3 --threads 2 --timeout 120 \
--bind unix:/run/gunicorn/cargochains.sock \
--access-logfile /var/log/cargochains/gunicorn.access \
--error-logfile /var/log/cargochains/gunicorn.error \
--log-level warning \
config.wsgi:application
UMask=007
Restart=always
RestartSec=3
[Install]
WantedBy=multi-user.target