services:
  seabot:
    build:
      context: .
      dockerfile: Dockerfile
    container_name: seabot
    restart: unless-stopped
    
    environment:
      # Telegram Bot
      - TELEGRAM_BOT_TOKEN=${TELEGRAM_BOT_TOKEN}
      - TELEGRAM_API_ID=${TELEGRAM_API_ID}
      - TELEGRAM_API_HASH=${TELEGRAM_API_HASH}
      - TELEGRAM_PHONE=${TELEGRAM_PHONE}
      
      # X.com (optional)
      - X_BEARER_TOKEN=${X_BEARER_TOKEN:-}
      - X_API_KEY=${X_API_KEY:-}
      - X_API_SECRET=${X_API_SECRET:-}
      - X_ACCESS_TOKEN=${X_ACCESS_TOKEN:-}
      - X_ACCESS_TOKEN_SECRET=${X_ACCESS_TOKEN_SECRET:-}
      
      # Instagram / Meta API (optional)
      - INSTAGRAM_APP_ID=${INSTAGRAM_APP_ID:-}
      - INSTAGRAM_APP_SECRET=${INSTAGRAM_APP_SECRET:-}
      - INSTAGRAM_ACCESS_TOKEN=${INSTAGRAM_ACCESS_TOKEN:-}
      # Legacy Instagram credentials (for web scraping fallback)
      - INSTAGRAM_USERNAME=${INSTAGRAM_USERNAME:-}
      - INSTAGRAM_PASSWORD=${INSTAGRAM_PASSWORD:-}
      
      # Configuration
      - DATABASE_URL=sqlite:////app/data/seabot.db
      - PARSE_INTERVAL_HOURS=${PARSE_INTERVAL_HOURS:-1}
      - LOG_LEVEL=${LOG_LEVEL:-INFO}
      - PYTHONUNBUFFERED=1
    
    volumes:
      # Персистентное хранилище для базы данных
      - seabot-data:/app/data
      # Сессии парсеров
      - ./sessions:/app/sessions
      # Логи
      - ./logs:/app/logs
      # Бэкапы
      - ./backups:/app/backups
      # Конфигурация источников
      - ./config:/app/config
    
    networks:
      - seabot-network
    
    logging:
      driver: "json-file"
      options:
        max-size: "10m"
        max-file: "3"

networks:
  seabot-network:
    driver: bridge

volumes:
  seabot-data:

