version: "3.8"

services:
  schedule:
    build: .
    container_name: schedule-api
    restart: always
    ports:
      - "8765:8765"
    environment:
      - SCHEDULE_HOST=0.0.0.0
      - SCHEDULE_PORT=8765
      - DASHBOARD_URL=http://YOUR_SERVER_IP:8765/dashboard.html
      - TZ=Asia/Shanghai
    volumes:
      - ./data:/app/data          # 持久化任务数据
      - ./logs:/app/logs          # 推送日志
    healthcheck:
      test: ["CMD", "python3", "-c", "import urllib.request; urllib.request.urlopen('http://localhost:8765/api/tasks')"]
      interval: 30s
      timeout: 3s
      retries: 3
