fix(gunicorn): preload 後重置 SQLAlchemy 連線池
Some checks failed
CD Pipeline / deploy (push) Failing after 9m32s

This commit is contained in:
OoO
2026-04-30 00:07:10 +08:00
parent 5a61c020e3
commit 8bc0fd7ff6
3 changed files with 73 additions and 4 deletions

View File

@@ -47,8 +47,8 @@ services:
- "com.centurylinklabs.watchtower.enable=true"
ports:
- "127.0.0.1:5003:80" # 僅本地連線,透過 Nginx 反向代理nginx 反代 5003
# 強制使用 gunicorn 綁定 port 80 (覆蓋 Dockerfile CMD)
command: ["gunicorn", "--bind", "0.0.0.0:80", "--workers", "4", "--timeout", "300", "--access-logfile", "-", "--error-logfile", "-", "--preload", "app:app"]
# 強制使用 gunicorn 綁定 port 80 (覆蓋 Dockerfile CMD)preload + post_fork DB pool reset 見 gunicorn.conf.py
command: ["gunicorn", "--config", "gunicorn.conf.py", "app:app"]
volumes:
# 持久化數據
- ./data:/app/data