This commit is contained in:
Mateusz Gruszczyński
2026-05-04 10:43:31 +02:00
parent 95fb7649f2
commit 31bba1269d
9 changed files with 94 additions and 27 deletions

View File

@@ -8,22 +8,20 @@ Wants=network-online.target
[Service]
Type=simple
#User=root
#Group=root
User=pytorrent
Group=pytorrent
WorkingDirectory=/opt/pyTorrent
Environment="PYTHONUNBUFFERED=1"
EnvironmentFile=/opt/pyTorrent/.env
ExecStart=/opt/pyTorrent/venv/bin/python /opt/pyTorrent/app.py
# Note: production starts through Gunicorn, so Socket.IO keeps WebSocket/thread support without unsafe Werkzeug.
ExecStart=/opt/pyTorrent/venv/bin/gunicorn --worker-class gthread --workers 1 --threads 32 --bind ${PYTORRENT_HOST}:${PYTORRENT_PORT} --access-logfile - --error-logfile - wsgi:app
Restart=always
RestartSec=3
KillSignal=SIGINT
TimeoutStopSec=20
# opcjonalnie
NoNewPrivileges=true
PrivateTmp=true
[Install]
WantedBy=multi-user.target
WantedBy=multi-user.target