Skip to content

Commit cd9d84a

Browse files
committed
generated file: gunicorn.conf.py
1 parent 106bc21 commit cd9d84a

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

gunicorn.conf.py

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
from dotenv import load_dotenv
2+
import os
3+
import multiprocessing
4+
5+
load_dotenv()
6+
7+
bind = os.environ.get('GUNICORN_BIND', '0.0.0.0:8000')
8+
workers = multiprocessing.cpu_count() * 2 + 1
9+
worker_class = 'uvicorn.workers.UvicornWorker'
10+
reload = True
11+
12+
loglevel = os.environ.get('LOG_LEVEL', 'info')
13+
accesslog = '-'
14+
errorlog = '-'
15+
16+
timeout = 60
17+
graceful_timeout = 15
18+
keepalive = 5
19+
worker_timeout = 60
20+
max_requests = 1000
21+
max_requests_jitter = 50
22+
max_request_jitter = 100
23+
start_class = "gunicorn.workers.ggevent.GeventWorker"
24+
preload_app = True
25+
daemon = False
26+
pidfile = '/var/run/gunicorn.pid'
27+
proc_name = 'openai_api_client'
28+
raw_env = ["OPENAI_API_KEY=" + os.environ["OPENAI_API_KEY"],
29+
"DATABASE_URL=" + os.environ["DATABASE_URL"],
30+
"SECRET_KEY=" + os.environ["SECRET_KEY"],
31+
"LOG_LEVEL=" + os.environ["LOG_LEVEL"]]

0 commit comments

Comments
 (0)