services:
  movie-search:
    build: .
    container_name: movie-search
    environment:
      - TMDB_API_KEY=6d58225585fb77af5945a964de41849f
      - HOST=0.0.0.0
      - PORT=8000
      - TORAPI_URL=http://torrent-api:8000
      - TORRENT_SEARCH_URL=http://host.docker.internal:8443
      - TORRENT_ADD_URL=http://host.docker.internal:8088
      - QBITTORRENT_USERNAME=admin
      - QBITTORRENT_PASSWORD=vrubel07
      - QBITTORRENT_HOST=host.docker.internal
      - QBITTORRENT_PORT=8080
    ports:
      - "8089:8000"
    restart: unless-stopped
    extra_hosts:
      - "host.docker.internal:host-gateway"
    networks:
      - torrentvideo_default
      - default

  torapi-search:
    image: lifailon/torapi:latest
    container_name: TorAPI-Search
    environment:
      - USERNAME=
      - PASSWORD=
    ports:
      - "8443:8443"
    restart: unless-stopped
    networks:
      - torrentvideo_default
      - default

  torapi-qbittorrent:
    image: lifailon/torapi:latest
    container_name: TorAPI-qBittorrent
    environment:
      - USERNAME=admin
      - PASSWORD=vrubel07
      - PROXY_ADDRESS=172.17.0.1
      - PROXY_PORT=8080
    ports:
      - "8444:8443"
    restart: unless-stopped
    networks:
      - torrentvideo_default
      - default

  telegram-bot:
    build:
      context: .
      dockerfile: Dockerfile.telegram
    container_name: telegram-bot
    environment:
      - TMDB_API_KEY=6d58225585fb77af5945a964de41849f
      - TORRENT_SEARCH_URL=http://host.docker.internal:8443
      - TORRENT_ADD_URL=http://host.docker.internal:8088
      - QBITTORRENT_USERNAME=admin
      - QBITTORRENT_PASSWORD=vrubel07
      - QBITTORRENT_HOST=host.docker.internal
      - QBITTORRENT_PORT=8080
    restart: unless-stopped
    extra_hosts:
      - "host.docker.internal:host-gateway"
    networks:
      - torrentvideo_default
      - default
    depends_on:
      - movie-search
      - torapi-search
      - torapi-qbittorrent

networks:
  torrentvideo_default:
    external: true
