refactor(docker): 优化 Gunicorn 配置并提升代码可读性

使 Gunicorn 的 max-requests 参数可通过环境变量 MAX_REQUESTS 配置,
并自动计算 max-requests-jitter (默认为 MAX_REQUESTS 的 1/20),
同时统一规范化 Dockerfile 中多行字符串的缩进格式
This commit is contained in:
AAEE86
2026-02-11 17:14:32 +08:00
parent 2849a9bce5
commit 875ecca527
3 changed files with 213 additions and 202 deletions

View File

@@ -38,6 +38,15 @@ ADMIN_PASSWORD=admin123456
# 应用端口(默认 8084
# APP_PORT=8084
# Gunicorn Worker 数量(默认 4
# 建议最小设置为 2
# GUNICORN_WORKERS=4
# Gunicorn Max Requests默认 4000
# Worker 处理指定数量请求后自动重启,防止内存泄漏
# max-requests-jitter 会自动设置为 MAX_REQUESTS/20 (5%)
# MAX_REQUESTS=4000
# API Key 前缀(默认 sk
# API_KEY_PREFIX=sk