[Unit] Description=EUSRR backend (%i slot) After=network-online.target redis-server.service Wants=network-online.target redis-server.service [Service] Type=simple User=deploy Group=www-data WorkingDirectory=/srv/eusrr-slots/%i/backend EnvironmentFile=/etc/eusrr/slots/%i.env Environment=DJANGO_SETTINGS_MODULE=eusrr_backend.settings Environment=PYTHONUNBUFFERED=1 ExecStart=/srv/eusrr-slots/%i/backend/.venv/bin/python -m gunicorn -k uvicorn.workers.UvicornWorker --bind 127.0.0.1:${BACKEND_PORT} --workers 2 --timeout 60 --graceful-timeout 30 --access-logfile - --error-logfile - --log-level info eusrr_backend.asgi:application Restart=always RestartSec=3 # TERM lets Gunicorn drain requests. Signal the master first; its workers are # force-killed only after a deadline longer than --graceful-timeout. KillSignal=SIGTERM KillMode=mixed TimeoutStopSec=60 NoNewPrivileges=yes StandardOutput=journal StandardError=journal SyslogIdentifier=eusrr-backend-%i [Install] WantedBy=multi-user.target