first commit

This commit is contained in:
rjb
2025-12-21 00:20:27 +08:00
commit 6fb3c6c23d
42 changed files with 2265 additions and 0 deletions

39
gunicorn.conf.py Normal file
View File

@@ -0,0 +1,39 @@
"""
Gunicorn配置文件
生产环境使用
"""
import multiprocessing
import os
# 服务器socket
bind = f"0.0.0.0:{os.environ.get('PORT', 5000)}"
backlog = 2048
# 工作进程
workers = multiprocessing.cpu_count() * 2 + 1
worker_class = 'sync'
worker_connections = 1000
timeout = 30
keepalive = 2
# 日志
accesslog = 'logs/gunicorn_access.log'
errorlog = 'logs/gunicorn_error.log'
loglevel = 'info'
access_log_format = '%(h)s %(l)s %(u)s %(t)s "%(r)s" %(s)s %(b)s "%(f)s" "%(a)s"'
# 进程命名
proc_name = 'your_app'
# 服务器机制
daemon = False
pidfile = 'gunicorn.pid'
umask = 0
user = None
group = None
tmp_upload_dir = None
# SSL如果需要
# keyfile = '/path/to/keyfile'
# certfile = '/path/to/certfile'