feat(api): use uvicorn as asgi server with gunicorn

This commit is contained in:
jo 2022-07-06 17:25:04 +02:00 committed by Kyle Robbertze
parent 1cb03c35d2
commit 7c26020c80
3 changed files with 6 additions and 2 deletions

View File

@ -13,9 +13,10 @@ Environment=LIBRETIME_CONFIG_FILEPATH=@@CONFIG_FILEPATH@@
ExecStart=/usr/bin/gunicorn \ ExecStart=/usr/bin/gunicorn \
--workers 4 \ --workers 4 \
--worker-class uvicorn.workers.UvicornWorker \
--log-file - \ --log-file - \
--bind unix:/run/libretime-api.sock \ --bind unix:/run/libretime-api.sock \
libretime_api.wsgi libretime_api.asgi
ExecReload=/bin/kill -s HUP $MAINPID ExecReload=/bin/kill -s HUP $MAINPID
User=libretime User=libretime
Group=libretime Group=libretime

View File

@ -5,7 +5,7 @@ PartOf=libretime-api.service
[Socket] [Socket]
ListenStream=/run/libretime-api.sock ListenStream=/run/libretime-api.sock
SocketUser=@@DEFAULT_WEB_USER@@ SocketUser=@@DEFAULT_WEB_USER@@
SocketMode=640 SocketMode=660
[Install] [Install]
WantedBy=sockets.target WantedBy=sockets.target

View File

@ -4,6 +4,9 @@ python3 = buster, bullseye, bionic, focal
python3-pip = buster, bullseye, bionic, focal python3-pip = buster, bullseye, bionic, focal
gunicorn = buster, bullseye, bionic, focal gunicorn = buster, bullseye, bionic, focal
python3-gunicorn = buster, bullseye, bionic, focal python3-gunicorn = buster, bullseye, bionic, focal
python3-uvicorn = buster, bullseye, bionic, focal
python3-httptools = buster, bullseye, bionic, focal
python3-uvloop = buster, bullseye, bionic, focal
[psycopg2] [psycopg2]
# See https://www.psycopg.org/docs/install.html#install-from-source # See https://www.psycopg.org/docs/install.html#install-from-source