Skip to content

Commit

Permalink
Merge pull request #71 from RSE-Sheffield/chore/gunicorn-config
Browse files Browse the repository at this point in the history
Add Gunicorn config file
  • Loading branch information
f-allian authored Jan 29, 2025
2 parents bdadf62 + 4a036b3 commit 4e16fb6
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 0 deletions.
17 changes: 17 additions & 0 deletions .github/workflows/check-gunicorn-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: Check Gunicorn config
on:
push:
branches:
- main
jobs:
lint:
runs-on: ubuntu-24.04
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Python
uses: actions/[email protected]
- name: Install Gunicorn
run: pip install gunicorn
- name: Check Gunicorn config
run: gunicorn --config ./gunicorn.conf.py --check-config
13 changes: 13 additions & 0 deletions gunicorn.conf.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Gunicorn settings
# https://docs.gunicorn.org/en/stable/configure.html#configuration-file
# https://docs.gunicorn.org/en/stable/settings.html

import multiprocessing
import os

bind = os.getenv('GUNICORN_BIND', "127.0.0.1:8000")
workers = int(os.getenv("GUNICORN_WORKERS", multiprocessing.cpu_count() * 2 + 1))
capture_output = bool(os.getenv("GUNICORN_CAPTURE_OUTPUT", True))
loglevel = os.getenv("GUNICORN_LOGLEVEL", "INFO")
accesslog = os.getenv("GUNICORN_ACCESSLOG")
errorlog = os.getenv("GUNICORN_ERRORLOG", "-")

0 comments on commit 4e16fb6

Please sign in to comment.