From 282698f9ac1f65383f26dd4e2952b41e4f9dd6e2 Mon Sep 17 00:00:00 2001 From: Andrew Conlin Date: Thu, 10 Apr 2025 21:33:25 +0100 Subject: [PATCH] [2025-04-10] Add gunicorn config and requirements.txt https://developers.redhat.com/articles/2023/08/17/how-deploy-flask-application-python-gunicorn --- gunicorn_config.py | 9 +++++++++ requirements.txt | 2 ++ 2 files changed, 11 insertions(+) create mode 100644 gunicorn_config.py create mode 100644 requirements.txt diff --git a/gunicorn_config.py b/gunicorn_config.py new file mode 100644 index 0000000..5fc651f --- /dev/null +++ b/gunicorn_config.py @@ -0,0 +1,9 @@ +import os + +workers = int(os.environ.get('GUNICORN_PROCESSES', '2')) +threads = int(os.environ.get('GUNICORN_THREADS', '4')) +# timeout = int(os.environ.get('GUNICORN_TIMEOUT', '120')) +bind = os.environ.get('GUNICORN_BIND', '0.0.0.0:8080') + +forwarded_allow_ips = '*' +secure_scheme_headers = { 'X-Forwarded-Proto': 'https' } diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..8b52312 --- /dev/null +++ b/requirements.txt @@ -0,0 +1,2 @@ +Flask==3.1.0 +Gunicorn==23.0.0