Files
PolyWeather/docker-compose.yml
T

34 lines
1.3 KiB
YAML
Raw Normal View History

services:
polyweather:
build: .
container_name: polyweather_bot
restart: unless-stopped
env_file:
- .env
volumes:
# 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.
- ${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 # 挂载日志文件
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.
user: "${UID:-1000}:${GID:-1000}"
polyweather_web:
build: .
container_name: polyweather_web
restart: unless-stopped
command: python web/app.py
env_file:
- .env
volumes:
2026-03-20 22:00:02 +08:00
# 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"
2026-03-20 22:00:02 +08:00
# UID/GID are mainly useful on Linux hosts to avoid root-owned output files.
user: "${UID:-1000}:${GID:-1000}"