fix(dispatcharr): switch from gunicorn to uwsgi

This commit is contained in:
MickLesk
2026-05-07 20:58:47 +02:00
parent be2e3a4a3a
commit c812bb6eb1

View File

@@ -38,7 +38,7 @@ msg_info "Installing Python Dependencies with uv"
cd /opt/dispatcharr
$STD uv venv --clear
$STD uv sync
$STD uv pip install gunicorn gevent celery redis daphne
$STD uv pip install uwsgi gevent celery redis daphne
msg_ok "Installed Python Dependencies"
msg_info "Configuring Dispatcharr"
@@ -118,7 +118,7 @@ server {
proxy_set_header X-Forwarded-Proto \$scheme;
}
# All other requests proxy to Gunicorn
# All other requests proxy to uWSGI
location / {
include proxy_params;
proxy_pass http://127.0.0.1:5656;
@@ -131,20 +131,30 @@ systemctl restart nginx
msg_ok "Configured Nginx"
msg_info "Creating Services"
cat <<EOF >/opt/dispatcharr/start-gunicorn.sh
cat <<EOF >/opt/dispatcharr/start-uwsgi.sh
#!/usr/bin/env bash
cd /opt/dispatcharr
set -a
source .env
set +a
exec uv run gunicorn \\
exec .venv/bin/uwsgi \\
--chdir=/opt/dispatcharr \\
--module=dispatcharr.wsgi:application \\
--master \\
--workers=4 \\
--worker-class=gevent \\
--timeout=300 \\
--bind 0.0.0.0:5656 \\
dispatcharr.wsgi:application
--gevent=400 \\
--http=0.0.0.0:5656 \\
--http-keepalive=1 \\
--http-timeout=600 \\
--socket-timeout=600 \\
--buffer-size=65536 \\
--post-buffering=4096 \\
--lazy-apps \\
--thunder-lock \\
--die-on-term \\
--vacuum
EOF
chmod +x /opt/dispatcharr/start-gunicorn.sh
chmod +x /opt/dispatcharr/start-uwsgi.sh
cat <<EOF >/opt/dispatcharr/start-celery.sh
#!/usr/bin/env bash
@@ -184,7 +194,7 @@ After=network.target postgresql.service redis-server.service
[Service]
Type=simple
WorkingDirectory=/opt/dispatcharr
ExecStart=/opt/dispatcharr/start-gunicorn.sh
ExecStart=/opt/dispatcharr/start-uwsgi.sh
Restart=on-failure
RestartSec=10
User=root