2026-03-29 23:36:53 +08:00
|
|
|
x-polyweather-base: &polyweather-base
|
|
|
|
|
build: .
|
|
|
|
|
image: polyweather-app:latest
|
|
|
|
|
env_file:
|
|
|
|
|
- .env
|
|
|
|
|
|
2026-03-03 00:01:57 +08:00
|
|
|
services:
|
|
|
|
|
polyweather:
|
2026-03-29 23:36:53 +08:00
|
|
|
<<: *polyweather-base
|
2026-03-03 00:01:57 +08:00
|
|
|
container_name: polyweather_bot
|
|
|
|
|
restart: unless-stopped
|
|
|
|
|
volumes:
|
2026-03-13 17:18:06 +08:00
|
|
|
# Persist runtime data outside git workspace.
|
2026-03-20 22:00:02 +08:00
|
|
|
# Host path defaults to /var/lib/polyweather and can be overridden in .env.
|
2026-03-13 17:18:06 +08:00
|
|
|
- ${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
|
2026-03-03 00:01:57 +08:00
|
|
|
- ./bot.log:/app/bot.log # 挂载日志文件
|
2026-03-20 22:00:02 +08:00
|
|
|
# UID/GID are mainly useful on Linux hosts to avoid root-owned output files.
|
|
|
|
|
# Windows / macOS can usually keep the fallback values.
|
2026-03-03 00:01:57 +08:00
|
|
|
user: "${UID:-1000}:${GID:-1000}"
|
2026-03-03 21:27:57 +08:00
|
|
|
|
|
|
|
|
polyweather_web:
|
2026-03-29 23:36:53 +08:00
|
|
|
<<: *polyweather-base
|
2026-03-03 21:27:57 +08:00
|
|
|
container_name: polyweather_web
|
|
|
|
|
restart: unless-stopped
|
|
|
|
|
command: python web/app.py
|
|
|
|
|
volumes:
|
2026-03-20 22:00:02 +08:00
|
|
|
# Web service shares the same runtime data directory as bot/state tasks.
|
2026-03-13 17:18:06 +08:00
|
|
|
- ${POLYWEATHER_RUNTIME_DATA_DIR:-/var/lib/polyweather}:/var/lib/polyweather
|
|
|
|
|
- ${POLYWEATHER_RUNTIME_DATA_DIR:-/var/lib/polyweather}:/app/data
|
2026-03-03 21:27:57 +08:00
|
|
|
ports:
|
|
|
|
|
- "8000:8000"
|
2026-03-20 22:00:02 +08:00
|
|
|
# UID/GID are mainly useful on Linux hosts to avoid root-owned output files.
|
2026-03-03 21:27:57 +08:00
|
|
|
user: "${UID:-1000}:${GID:-1000}"
|
2026-04-01 01:49:58 +08:00
|
|
|
|
2026-04-08 06:53:49 +08:00
|
|
|
polyweather_prewarm:
|
|
|
|
|
<<: *polyweather-base
|
|
|
|
|
container_name: polyweather_prewarm
|
|
|
|
|
restart: unless-stopped
|
|
|
|
|
profiles: ["workers"]
|
2026-05-15 04:15:58 +08:00
|
|
|
command: python scripts/prewarm_dashboard_worker.py --include-detail --include-market --force-refresh
|
2026-04-08 06:53:49 +08:00
|
|
|
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}"
|
|
|
|
|
|