version: '3.8'

services:
  ai-proxy:
    build:
      context: .
      dockerfile: Dockerfile
    container_name: ai-proxy
    restart: unless-stopped
    ports:
      - "8989:8989"
    environment:
      - TZ=Asia/Shanghai
    volumes:
      # 持久化数据
      - ./data:/app/data
      - ./uploads:/app/uploads
      - ./log:/app/log
      # 配置文件（可选，如果需要自定义配置）
      - ./server/config.yaml:/app/config.yaml
    networks:
      - ai-proxy-network
    healthcheck:
      test: ["CMD", "wget", "--no-verbose", "--tries=1", "--spider", "http://localhost:8989/api/health"]
      interval: 30s
      timeout: 3s
      retries: 3
      start_period: 10s

networks:
  ai-proxy-network:
    driver: bridge
