refactor(cache): 統一 cache SOT 並啟用 gunicorn preload

ADR-017 Phase 3f-2:新增 services/cache_manager.py,讓 sales/import/export/daily/dashboard 共用同一份 in-memory cache;cache_service 改為相容 shim;Dockerfile/docker-compose 啟用 gunicorn --preload。
This commit is contained in:
OoO
2026-04-29 21:35:56 +08:00
parent 2550ab45b1
commit 13fa165ee2
10 changed files with 172 additions and 155 deletions

View File

@@ -48,7 +48,7 @@ services:
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", "-", "app:app"]
command: ["gunicorn", "--bind", "0.0.0.0:80", "--workers", "4", "--timeout", "300", "--access-logfile", "-", "--error-logfile", "-", "--preload", "app:app"]
volumes:
# 持久化數據
- ./data:/app/data