Skip to content

Instantly share code, notes, and snippets.

@senz
Created July 19, 2023 16:54
Show Gist options
  • Save senz/aff01eb80f4854827359fbc635dbe83c to your computer and use it in GitHub Desktop.
Save senz/aff01eb80f4854827359fbc635dbe83c to your computer and use it in GitHub Desktop.
Invidious in docker (with traefik)

Guide to setup Invidious instance using docker and traefik

  1. setup traefik This is a bit out of the scope of this guide. I set traefik outside of this docker compose file, since its beign used by many separate setups on my machine. But you can put traefik in the same override file, if you do not intend to use it for other service (but it makes no sense to use it at all in that case). I use combination os OSX's /etc/resolver and dnsmasq to resolve subdomain.test. tld to localhost adresses.

  2. clone repo https://github.com/iv-org/invidious/

  3. comment out "ports:" section of invidious service. Unfortunately there is no way to override it. You can leave it as it is, but then using traefik makes less sense.

  4. copy provided docker-compose.yml in the same repo. Set a random password for db, and hmac_key Use appropriate Dockerfile to build dist image. (arm64 in my case) Pay attention to default network name (must be the same as in traefik network)

  5. docker compose up -d to boot up whole setup

Traefik will make instance reachable throug 'inv.test' hostname

version: "3"
services:
invidious:
build:
dockerfile: docker/Dockerfile.arm64
ports: []
environment:
INVIDIOUS_CONFIG: |
db:
dbname: invidious
user: invdbuser
password: "<PUT_RANDOM_PASSWORD_HERE>"
host: invidious-db
port: 5432
check_tables: true
external_port: 443
domain: inv.test
https_only: true
# statistics_enabled: false
hmac_key: "<RANDOM_HMAC_HERE<"
labels:
- "traefik.enable=true"
- "traefik.http.routers.invidious.rule=Host(`inv.test`)"
- "traefik.http.routers.invidious.entrypoints=websecure"
- "traefik.http.routers.invidious.tls=true"
- "traefik.http.services.server-invidious.loadbalancer.server.port=3000"
invidious-db:
environment:
POSTGRES_USER: invdbuser
POSTGRES_PASSWORD: "<PUT_RANDOM_PASSWORD_HERE(BUT SAME AS ABOVE)>"
networks:
default:
external: true
name: traefik_default
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment