diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index e0d107d..ae65c13 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -109,12 +109,6 @@ djlint: script: - djlint website/ --lint --check -gunicorn_check: - extends: .python_test_template - script: - - apt-get update && apt-get install --yes libpq-dev - - gunicorn --check-config --config etc/gunicorn.conf.py - npm_lint: image: node:20-slim stage: test diff --git a/Dockerfile b/Dockerfile index fe1bdc7..e38e94e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -39,7 +39,14 @@ ADD https://github.com/just-containers/s6-overlay/releases/download/v${S6_OVERLA RUN tar -C / -Jxpf /tmp/s6-overlay-noarch.tar.xz && tar -C / -Jxpf /tmp/s6-overlay-x86_64.tar.xz ENV PATH=$VIRTUAL_ENV/bin:$PATH \ - PYTHONUNBUFFERED=1 + PYTHONUNBUFFERED=1 \ + GRANIAN_INTERFACE=wsgi \ + GRANIAN_HOST=0.0.0.0 \ + GRANIAN_PORT=8080 \ + GRANIAN_WORKERS_LIFETIME=1800 \ + GRANIAN_RESPAWN_INTERVAL=10 \ + GRANIAN_PROCESS_NAME=website \ + GRANIAN_RESPAWN_FAILED_WORKERS=1 EXPOSE 8000 diff --git a/etc/gunicorn.conf.py b/etc/gunicorn.conf.py deleted file mode 100644 index ae4ff32..0000000 --- a/etc/gunicorn.conf.py +++ /dev/null @@ -1,10 +0,0 @@ -wsgi_app = "website.wsgi:application" -disable_redirect_access_to_syslog = True -preload_app = True -bind = "127.0.0.1:8080" -max_requests = 1200 -max_requests_jitter = 50 -forwarded_allow_ips = "*" - -# Run additional threads so the GIL isn't sitting completely idle -threads = 4 diff --git a/etc/s6-rc.d/django/run b/etc/s6-rc.d/django/run index c7c071d..72c4468 100644 --- a/etc/s6-rc.d/django/run +++ b/etc/s6-rc.d/django/run @@ -4,4 +4,4 @@ set -e cd /app -exec gunicorn -c etc/gunicorn.conf.py +exec granian website.wsgi:application diff --git a/requirements.txt b/requirements.txt index 2b0363a..4ce16ee 100644 --- a/requirements.txt +++ b/requirements.txt @@ -7,7 +7,7 @@ beautifulsoup4[lxml] requests wagtail-generic-chooser==0.6 django-redis==5.4.0 -gunicorn==22.0.0 +granian[pname]==1.6.0 psycopg==3.1.18 djangorestframework django-htmx==1.17.2