# 汽油价格监控 · 一键部署 # 用法:docker compose up -d --build services: oil-monitor: build: . container_name: oil-monitor restart: unless-stopped ports: - "8080:8080" volumes: - ./data:/app/data # SQLite 数据库(持久化;日志走 stdout,用 docker logs 查看) environment: - OIL_MONITOR_HOST=0.0.0.0 - OIL_MONITOR_PORT=8080 - OIL_MONITOR_TIMEZONE=Asia/Shanghai - TZ=Asia/Shanghai # 健康检查(探活 /api/health;alpine 自带 busybox wget) healthcheck: test: ["CMD", "wget", "-q", "-O", "-", "http://localhost:8080/api/health"] interval: 30s timeout: 5s retries: 3 start_period: 10s