Traefik Ingress for Tube Archivist

Tube Archivist is a pretty handy app–it lets you archive YouTube content (individual videos, playlists, or entire channels), complete with titles, descriptions, and optionally comments. It’s more limited than MeTube in that it only works with YT, but more featureful in that it gives you, pretty much, your own local YT. I’m frankly surprised that there isn’t an app for it, either under the older k8s-based system (even with TrueCharts) or under the newer Docker-based system.

No matter, they provide a compose file which makes deployment easy. And it does–until I decide I want to get fancy and use Traefik ingress for it. When I do that (using the following compose file), the tubearchivist container can’t talk to the archivist-redit container, and it fails. I strongly suspect this is due to adding the proxy network to that container, but I’m not quite sure how to fix it. Thoughts?

version: "3.5"
services:
  tubearchivist:
    container_name: tubearchivist
    restart: unless-stopped
    image: bbilly1/tubearchivist
    # ports:
    #   - 8000:8000
    volumes:
      - /mnt/video/youtube:/youtube
      - ./cache:/cache
    environment:
      - ES_URL=http://archivist-es:9200 # needs protocol e.g. http and port
      - REDIS_HOST=archivist-redis # don't add protocol
      - HOST_UID=568
      - HOST_GID=568
      - TA_HOST=ta.mydomain # set your host name
      - TA_USERNAME=dan # your initial TA credentials
      - TA_PASSWORD=password # your initial TA credentials
      - ELASTIC_PASSWORD=verysecret # set password for Elasticsearch
      - TZ=America/New_York # set your time zone
    healthcheck:
      test:
        - CMD
        - curl
        - -f
        - http://localhost:8000/health
      interval: 2m
      timeout: 10s
      retries: 3
      start_period: 30s
    depends_on:
      - archivist-es
      - archivist-redis
    networks:
      - proxy
  archivist-redis:
    image: redis/redis-stack-server
    container_name: archivist-redis
    restart: unless-stopped
    expose:
      - "6379"
    volumes:
      - ./redis:/data
    depends_on:
      - archivist-es
  archivist-es:
    image: bbilly1/tubearchivist-es # only for amd64, or use official es 8.16.0
    container_name: archivist-es
    restart: unless-stopped
    environment:
      - ELASTIC_PASSWORD=verysecret # matching Elasticsearch password
      - ES_JAVA_OPTS=-Xms1g -Xmx1g
      - xpack.security.enabled=true
      - discovery.type=single-node
      - path.repo=/usr/share/elasticsearch/data/snapshot
    ulimits:
      memlock:
        soft: -1
        hard: -1
    volumes:
      - ./es:/usr/share/elasticsearch/data # check for permission error when using bind mount, see readme
    expose:
      - "9200"
    labels:
      - traefik.enable=true
      - traefik.http.routers.ta.rule=Host(`ta.mydomain`)
      - traefik.http.routers.ta.entrypoints=https
      - traefik.http.routers.ta.tls=true
      - traefik.http.services.nzbget.loadbalancer.server.port=8000
      - homepage.group=Media
      - homepage.name=Tube Archivist
      - homepage.icon=tube-archivist
      - homepage.href=https://ta.mydomain
      - homepage.description=YouTube Bulk Downloader
      - homepage.widget.type=tubearchivist
      - homepage.widget.url=https://ta.mydomain
      - homepage.widget.key=
      - com.centurylinklabs.watchtower.enable='true'

networks:
  proxy:
    external: true

I believe i had a similar issue with fireflyiii and it’s data importer.
Try to add another network for the tube archivist container, e.g. tube_archivist_default, and the same network for the redis container. Then add this additional label to the tube archivist container:

"- traefik.docker.network=proxy"

this should allow redis to communicate over the tube_archivist_default network, but tells traefik to use the proxy network for ingress.

Edit:
Didn’t see it at the time of my post, but shouldn’t your labels be on the tube archivist container and not the elastic search one?

1 Like

Obviously they should be; no idea how I got that wrong.

And otherwise, that did it. For posterity, here’s the working Compose file:

version: "3.5"
services:
  tubearchivist:
    container_name: tubearchivist
    restart: unless-stopped
    image: bbilly1/tubearchivist
    volumes:
      - /mnt/video/youtube:/youtube
      - ./cache:/cache
    environment:
      - ES_URL=http://archivist-es:9200 # needs protocol e.g. http and port
      - REDIS_HOST=archivist-redis # don't add protocol
      - HOST_UID=568
      - HOST_GID=568
      - TA_HOST=ta.mydomain # set your host name
      - TA_USERNAME=dan # your initial TA credentials
      - TA_PASSWORD=password # your initial TA credentials
      - ELASTIC_PASSWORD=verysecret # set password for Elasticsearch
      - TZ=America/New_York # set your time zone
    healthcheck:
      test:
        - CMD
        - curl
        - -f
        - http://localhost:8000/health
      interval: 2m
      timeout: 10s
      retries: 3
      start_period: 30s
    depends_on:
      - archivist-es
      - archivist-redis
    networks:
      - proxy
      - tube-archivist
    labels:
      - traefik.enable=true
      - traefik.http.routers.ta.rule=Host(`ta.mydomain`)
      - traefik.http.routers.ta.entrypoints=https
      - traefik.http.routers.ta.tls=true
      - traefik.http.services.ta.loadbalancer.server.port=8000
      - traefik.docker.network=proxy
      - homepage.group=Media
      - homepage.name=Tube Archivist
      - homepage.icon=tube-archivist
      - homepage.href=https://ta.mydomain
      - homepage.description=YouTube Bulk Downloader
      - homepage.widget.type=tubearchivist
      - homepage.widget.url=https://ta.mydomain
      - homepage.widget.key=
      - com.centurylinklabs.watchtower.enable='true'
  archivist-redis:
    image: redis/redis-stack-server
    container_name: archivist-redis
    restart: unless-stopped
    expose:
      - "6379"
    volumes:
      - ./redis:/data
    depends_on:
      - archivist-es
    networks:
      - tube-archivist
  archivist-es:
    image: bbilly1/tubearchivist-es # only for amd64, or use official es 8.16.0
    container_name: archivist-es
    restart: unless-stopped
    environment:
      - ELASTIC_PASSWORD=verysecret # matching Elasticsearch password
      - ES_JAVA_OPTS=-Xms1g -Xmx1g
      - xpack.security.enabled=true
      - discovery.type=single-node
      - path.repo=/usr/share/elasticsearch/data/snapshot
    ulimits:
      memlock:
        soft: -1
        hard: -1
    volumes:
      - ./es:/usr/share/elasticsearch/data # check for permission error when using bind mount, see readme
    expose:
      - "9200"
    networks:
      - tube-archivist
networks:
  tube-archivist: {}
  proxy:
    external: true
2 Likes