services:
  tracker:
    image: python:3.12-alpine
    working_dir: /app
    command: ["python", "tracker.py"]
    volumes:
      - ${INTEROP_TRACKER_SCRIPT_PATH}:/app/tracker.py:ro
    ports:
      - "127.0.0.1:${INTEROP_TRACKER_PORT:-16969}:6969"

  superseedr_seed:
    build:
      context: ../..
      dockerfile: Dockerfile
    image: superseedr:interop
    container_name: ${INTEROP_PROJECT_NAME}_superseedr_seed
    tty: true
    stdin_open: true
    init: true
    environment:
      - SUPERSEEDR_CLIENT_PORT=16881
      - SUPERSEEDR_OUTPUT_STATUS_INTERVAL=${INTEROP_STATUS_INTERVAL:-2}
      - SUPERSEEDR_DEFAULT_DOWNLOAD_FOLDER=/superseedr-data/seed
    volumes:
      - ${INTEROP_SEED_DATA_PATH}:/superseedr-data/seed
      - ${INTEROP_SEED_CONFIG_PATH}:/root/.config/jagalite.superseedr
      - ${INTEROP_SEED_SHARE_PATH}:/root/.local/share/jagalite.superseedr
      - ${INTEROP_FIXTURES_PATH}:/fixtures:ro
    depends_on:
      - tracker

  superseedr_leech:
    build:
      context: ../..
      dockerfile: Dockerfile
    image: superseedr:interop
    container_name: ${INTEROP_PROJECT_NAME}_superseedr_leech
    tty: true
    stdin_open: true
    init: true
    environment:
      - SUPERSEEDR_CLIENT_PORT=16882
      - SUPERSEEDR_OUTPUT_STATUS_INTERVAL=${INTEROP_STATUS_INTERVAL:-2}
      - SUPERSEEDR_DEFAULT_DOWNLOAD_FOLDER=/superseedr-data/leech
    volumes:
      - ${INTEROP_LEECH_DATA_PATH}:/superseedr-data/leech
      - ${INTEROP_LEECH_CONFIG_PATH}:/root/.config/jagalite.superseedr
      - ${INTEROP_LEECH_SHARE_PATH}:/root/.local/share/jagalite.superseedr
      - ${INTEROP_FIXTURES_PATH}:/fixtures:ro
    depends_on:
      - tracker

  qbittorrent:
    image: lscr.io/linuxserver/qbittorrent:latest
    container_name: ${INTEROP_PROJECT_NAME}_qbittorrent
    tty: true
    stdin_open: true
    environment:
      - PUID=${INTEROP_UID:-1000}
      - PGID=${INTEROP_GID:-1000}
      - TZ=UTC
      - WEBUI_PORT=${INTEROP_QBIT_WEBUI_PORT:-18080}
    volumes:
      - ${INTEROP_QBIT_CONFIG_PATH:-/tmp/interop_qbit_config}:/config
      - ${INTEROP_QBIT_DOWNLOADS_PATH:-/tmp/interop_qbit_downloads}:/downloads
      - ${INTEROP_FIXTURES_PATH}:/fixtures:ro
    ports:
      - "127.0.0.1:${INTEROP_QBIT_WEBUI_PORT:-18080}:${INTEROP_QBIT_WEBUI_PORT:-18080}"
    depends_on:
      - tracker

  transmission:
    image: lscr.io/linuxserver/transmission:latest
    container_name: ${INTEROP_PROJECT_NAME}_transmission
    tty: true
    stdin_open: true
    environment:
      - PUID=1000
      - PGID=1000
      - TZ=UTC
      - USER=${INTEROP_TRANSMISSION_USER:-interop}
      - PASS=${INTEROP_TRANSMISSION_PASS:-interop}
      - PEERPORT=51413
    volumes:
      - ${INTEROP_TRANSMISSION_CONFIG_PATH:-/tmp/interop_transmission_config}:/config
      - ${INTEROP_TRANSMISSION_DOWNLOADS_PATH:-/tmp/interop_transmission_downloads}:/downloads
      - ${INTEROP_FIXTURES_PATH}:/fixtures:ro
    ports:
      - "127.0.0.1:${INTEROP_TRANSMISSION_RPC_PORT:-19091}:9091"
    depends_on:
      - tracker
