b27bedbca3
- uvicorn 改用 import string 格式启动 4 workers,防止数据采集阻塞 event loop - prewarm 去掉 --force-refresh,仅依赖缓存预热避免每 5 分钟全量采集 - 积分变动时同步写入 Supabase user_metadata,避免前端回退路径失败时显示 0 积分 - /api/auth/me 积分解析增加 Supabase email 回退路径
48 lines
1.8 KiB
YAML
48 lines
1.8 KiB
YAML
x-polyweather-base: &polyweather-base
|
|
build: .
|
|
image: polyweather-app:latest
|
|
env_file:
|
|
- .env
|
|
|
|
services:
|
|
polyweather:
|
|
<<: *polyweather-base
|
|
container_name: polyweather_bot
|
|
restart: unless-stopped
|
|
volumes:
|
|
# Persist runtime data outside git workspace.
|
|
# Host path defaults to /var/lib/polyweather and can be overridden in .env.
|
|
- ${POLYWEATHER_RUNTIME_DATA_DIR:-/var/lib/polyweather}:/var/lib/polyweather
|
|
# Keep /app/data compatibility for existing cache/state defaults.
|
|
- ${POLYWEATHER_RUNTIME_DATA_DIR:-/var/lib/polyweather}:/app/data
|
|
- ./bot.log:/app/bot.log # 挂载日志文件
|
|
# UID/GID are mainly useful on Linux hosts to avoid root-owned output files.
|
|
# Windows / macOS can usually keep the fallback values.
|
|
user: "${UID:-1000}:${GID:-1000}"
|
|
|
|
polyweather_web:
|
|
<<: *polyweather-base
|
|
container_name: polyweather_web
|
|
restart: unless-stopped
|
|
command: python web/app.py
|
|
volumes:
|
|
# Web service shares the same runtime data directory as bot/state tasks.
|
|
- ${POLYWEATHER_RUNTIME_DATA_DIR:-/var/lib/polyweather}:/var/lib/polyweather
|
|
- ${POLYWEATHER_RUNTIME_DATA_DIR:-/var/lib/polyweather}:/app/data
|
|
ports:
|
|
- "8000:8000"
|
|
# UID/GID are mainly useful on Linux hosts to avoid root-owned output files.
|
|
user: "${UID:-1000}:${GID:-1000}"
|
|
|
|
polyweather_prewarm:
|
|
<<: *polyweather-base
|
|
container_name: polyweather_prewarm
|
|
restart: unless-stopped
|
|
profiles: ["workers"]
|
|
command: python scripts/prewarm_dashboard_worker.py --include-detail --include-market
|
|
volumes:
|
|
- ${POLYWEATHER_RUNTIME_DATA_DIR:-/var/lib/polyweather}:/var/lib/polyweather
|
|
- ${POLYWEATHER_RUNTIME_DATA_DIR:-/var/lib/polyweather}:/app/data
|
|
user: "${UID:-1000}:${GID:-1000}"
|
|
|