This commit is contained in:
Mateusz Gruszczyński
2025-08-28 22:54:52 +02:00
parent fe932e7a9f
commit 01b8ff656e
6 changed files with 419 additions and 256 deletions

View File

@@ -1,15 +1,27 @@
# /etc/systemd/system/listapp.service
[Unit]
Description=ListApp - Flask application for hosts file conversion
After=network.target redis.service
After=network-online.target redis.service
Wants=network-online.target
[Service]
User=www-data
Group=www-data
WorkingDirectory=/var/www/listapp
# Globalne env + nadpisania (opcjonalne; minus oznacza „jeśli istnieje”)
EnvironmentFile=-/var/www/listapp/.env
# Ścieżka do virtualenv
Environment="PATH=/var/www/listapp/venv/bin"
#ExecStart=/var/www/listapp/bin/gunicorn -w 2 --bind 127.0.0.1:8283 app:app
ExecStart=/var/www/listapp/bin/gunicorn -k uvicorn.workers.UvicornWorker -w 4 --bind 127.0.0.1:8283 app:asgi_app
# Gunicorn + UvicornWorker (ASGI)
ExecStart=/var/www/listapp/venv/bin/gunicorn \
-k uvicorn.workers.UvicornWorker \
--workers 4 \
--bind 127.0.0.1:8283 \
--keep-alive 30 \
--timeout 90 \
app:asgi_app
Restart=always
RestartSec=5