services:
  telegram-bot:
    build:
      context: job-seeker-tools
      dockerfile: Dockerfile
    image: job-seeker-tools:telegram-bot
    container_name: job-seeker-telegram-bot
    env_file:
      - .env
    environment:
      # Required - token must be set (either here or via .env)
      TELEGRAM_BOT_TOKEN: ${TELEGRAM_BOT_TOKEN}
      # Optional access control lists (comma-separated user IDs)
      TELEGRAM_ALLOWED_USER_IDS: ${TELEGRAM_ALLOWED_USER_IDS:-}
      TELEGRAM_ADMIN_IDS: ${TELEGRAM_ADMIN_IDS:-}
      # Ensure data paths inside container
      APPCONFIG__DATA_ROOT: /app/data
      APPCONFIG__SQLITE_PATH: /app/data/meta/sessions.db
      APPCONFIG__LOCK_DIR: /app/data/locks
    volumes:
      - ./data:/app/data
    restart: unless-stopped
    # No ports to expose; bot initiates outbound HTTPS connections only.

  company-researcher-api:
    build:
      context: job-seeker-tools
      dockerfile: Dockerfile
    ports:
      - "8000:8000"
    environment:
      - PYTHONUNBUFFERED=1
    healthcheck:
      test: ["CMD", "curl", "-f", "http://localhost:8000/health"]
      interval: 30s
      timeout: 10s
      retries: 3
      start_period: 40s
    restart: unless-stopped
