From 3b4f9ef477ba230d4b1aebd34fbc22c0fc39c732 Mon Sep 17 00:00:00 2001 From: jo Date: Wed, 10 May 2023 14:51:23 +0200 Subject: [PATCH] feat(api): install gunicorn/uvicorn from pip --- Dockerfile | 2 +- api/install/systemd/libretime-api.service | 2 +- api/packages.ini | 5 ----- api/requirements.txt | 2 ++ api/setup.py | 2 ++ 5 files changed, 6 insertions(+), 7 deletions(-) diff --git a/Dockerfile b/Dockerfile index 485f32430..c44d430be 100644 --- a/Dockerfile +++ b/Dockerfile @@ -151,7 +151,7 @@ WORKDIR /src COPY api/requirements.txt . RUN --mount=type=cache,target=/root/.cache/pip \ - pip install --no-compile gunicorn uvicorn -r requirements.txt + pip install --no-compile -r requirements.txt COPY --from=python-builder /build/shared/*.whl . RUN --mount=type=cache,target=/root/.cache/pip \ diff --git a/api/install/systemd/libretime-api.service b/api/install/systemd/libretime-api.service index f2fbd94c7..817996c43 100644 --- a/api/install/systemd/libretime-api.service +++ b/api/install/systemd/libretime-api.service @@ -23,7 +23,7 @@ Environment=LIBRETIME_LOG_FILEPATH=@@LOG_DIR@@/api.log Type=notify KillMode=mixed -ExecStart=/usr/bin/gunicorn \ +ExecStart=/usr/local/bin/gunicorn \ --workers 4 \ --worker-class uvicorn.workers.UvicornWorker \ --log-file - \ diff --git a/api/packages.ini b/api/packages.ini index bda6be438..b42831774 100644 --- a/api/packages.ini +++ b/api/packages.ini @@ -2,11 +2,6 @@ [python] python3 = focal, bullseye python3-pip = focal, bullseye -gunicorn = focal, bullseye -python3-gunicorn = focal, bullseye -python3-uvicorn = focal, bullseye -python3-httptools = focal, bullseye -python3-uvloop = focal, bullseye [psycopg2] # See https://www.psycopg.org/docs/install.html#install-from-source diff --git a/api/requirements.txt b/api/requirements.txt index 15c33548b..1348458a5 100644 --- a/api/requirements.txt +++ b/api/requirements.txt @@ -5,5 +5,7 @@ django-filter>=2.4.0,<23.3 django>=4.2.0,<4.3 djangorestframework @ git+https://github.com/encode/django-rest-framework@38a74b42da10576857d6bf8bd82a73b15d12a7ed drf-spectacular>=0.22.1,<0.27 +gunicorn>=20.1.0,<20.2 psycopg[c]>=3.1.8,<3.2 requests>=2.25.1,<2.31 +uvicorn[standard]>=0.17.6,<0.23.0 diff --git a/api/setup.py b/api/setup.py index 0e8e8bedf..ef0125ad3 100644 --- a/api/setup.py +++ b/api/setup.py @@ -33,7 +33,9 @@ setup( ], extras_require={ "prod": [ + "gunicorn>=20.1.0,<20.2", "psycopg[c]>=3.1.8,<3.2", + "uvicorn[standard]>=0.17.6,<0.23.0", ], "dev": [ "django-coverage-plugin>=3.0.0,<3.1",