services:
  # Standalone all-in-one image (nginx + backend via supervisord)
  app:
    image: git.viaeon.com/admin/taskpool:latest
    ports:
      - "3000:3000"
      - "8052:8052"
    volumes:
      - ./data:/app/data
      - ./configs:/app/configs
      - ./envs:/app/envs
    environment:
      - TZ=Asia/Shanghai
      - BH_SERVER_PORT=8052
      - BH_SERVER_HOST=0.0.0.0
      - BH_DB_TYPE=sqlite
      - BH_DB_PATH=/app/data/taskpool.db
    restart: unless-stopped

  # Redis (可选 - 用于缓存和队列)
  redis:
    image: redis:7-alpine
    ports:
      - "6379:6379"
    volumes:
      - redis_data:/data
    command: redis-server --appendonly yes
    restart: unless-stopped
    profiles:
      - redis  # 使用 --profile redis 启用

volumes:
  redis_data: