Kyoo

Innovative media browser designed for seamless streaming of anime, series and movies, offering advanced features like dynamic transcoding, auto watch history and intelligent metadata retrieval.

Directory Structure

    • .env
    • docker-compose.yml

docker-compose.yml

version: '3.9'
x-transcoder: &transcoder-base
  image: ghcr.io/zoriya/kyoo_transcoder:4.7
  networks:
    default:
      aliases:
        - transcoder
  restart: unless-stopped
  env_file:
    - ./.env
  environment:
    - GOCODER_PREFIX=/video
  volumes:
    - ${LIBRARY_ROOT}:/video:ro
    - ${CACHE_ROOT}:/cache
    - metadata:/metadata
 
services:
  back:
    image: ghcr.io/zoriya/kyoo_back:4.7
    restart: unless-stopped
    cpus: 1.5
    environment:
      - TRANSCODER_URL=${TRANSCODER_URL:-http://transcoder:7666}
    env_file:
      - ./.env
    depends_on:
      postgres:
        condition: service_healthy
      meilisearch:
        condition: service_healthy
      rabbitmq:
        condition: service_healthy
      migrations:
        condition: service_completed_successfully
    volumes:
      - kyoo:/metadata
    labels:
      - "traefik.enable=true"
      - "traefik.http.routers.api.rule=PathPrefix(`/api/`)"
      - "traefik.http.routers.api.middlewares=api-sp"
      - "traefik.http.middlewares.api-sp.stripprefix.prefixes=/api"
      - "traefik.http.middlewares.api-sp.stripprefix.forceSlash=false"
 
  migrations:
    image: ghcr.io/zoriya/kyoo_migrations:4.7
    restart: "no"
    depends_on:
      postgres:
        condition: service_healthy
    env_file:
      - ./.env
 
  front:
    image: ghcr.io/zoriya/kyoo_front:4.7
    restart: unless-stopped
    environment:
      - KYOO_URL=${KYOO_URL:-http://back:5000}
    labels:
      - "traefik.enable=true"
      - "traefik.http.routers.front.rule=PathPrefix(`/`)"
 
  scanner:
    image: ghcr.io/zoriya/kyoo_scanner:4.7
    restart: unless-stopped
    depends_on:
      back:
        condition: service_healthy
    env_file:
      - ./.env
    environment:
      - KYOO_URL=${KYOO_URL:-http://back:5000}
    volumes:
      - ${LIBRARY_ROOT}:/video:ro
 
  matcher:
    image: ghcr.io/zoriya/kyoo_scanner:4.7
    command: matcher
    restart: unless-stopped
    depends_on:
      back:
        condition: service_healthy
    env_file:
      - ./.env
    environment:
      - KYOO_URL=${KYOO_URL:-http://back:5000}
 
  autosync:
    image: ghcr.io/zoriya/kyoo_autosync:4.7
    restart: on-failure
    depends_on:
      rabbitmq:
        condition: service_healthy
    env_file:
      - ./.env
 
  transcoder:
    <<: *transcoder-base
    profiles: ['', 'cpu']
 
  transcoder-nvidia:
    <<: *transcoder-base
    deploy:
      resources:
        reservations:
          devices:
            - capabilities: [gpu]
    environment:
      - GOCODER_PREFIX=/video
      - GOCODER_HWACCEL=nvidia
    profiles: ['nvidia']
 
  transcoder-vaapi:
    <<: *transcoder-base
    devices:
      - /dev/dri:/dev/dri
    environment:
      - GOCODER_PREFIX=/video
      - GOCODER_HWACCEL=vaapi
      - GOCODER_VAAPI_RENDERER=${GOCODER_VAAPI_RENDERER:-/dev/dri/renderD128}
    profiles: ['vaapi']
  # qsv is the same setup as vaapi but with the hwaccel env var different
  transcoder-qsv:
    <<: *transcoder-base
    devices:
      - /dev/dri:/dev/dri
    environment:
      - GOCODER_PREFIX=/video
      - GOCODER_HWACCEL=qsv
      - GOCODER_VAAPI_RENDERER=${GOCODER_VAAPI_RENDERER:-/dev/dri/renderD128}
    profiles: ['qsv']
 
  traefik:
    image: traefik:v3.1
    restart: unless-stopped
    command:
      - "--providers.docker=true"
      - "--providers.docker.exposedbydefault=false"
      - "--entryPoints.web.address=:8901"
      - "--accesslog=true"
    ports:
      - "8901:8901"
    volumes:
      - "/var/run/docker.sock:/var/run/docker.sock:ro"
 
  postgres:
    image: postgres:15
    restart: unless-stopped
    env_file:
      - ./.env
    volumes:
      - db:/var/lib/postgresql/data
    healthcheck:
      test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER} -d ${POSTGRES_DB}"]
      interval: 5s
      timeout: 5s
      retries: 5
 
  meilisearch:
    image: getmeili/meilisearch:v1.4
    restart: unless-stopped
    volumes:
      - search:/meili_data
    environment:
      - MEILI_ENV=production
    env_file:
      - .env
    healthcheck:
      test: ["CMD", "wget", "--no-verbose", "--spider", "http://meilisearch:7700/health"]
      interval: 30s
      timeout: 5s
      retries: 5
 
  rabbitmq:
    image: rabbitmq:3-alpine
    restart: on-failure
    environment:
      - RABBITMQ_DEFAULT_USER=${RABBITMQ_DEFAULT_USER}
      - RABBITMQ_DEFAULT_PASS=${RABBITMQ_DEFAULT_PASS}
    healthcheck:
      test: rabbitmq-diagnostics -q ping
      interval: 30s
      timeout: 10s
      retries: 5
      start_period: 10s
 
volumes:
  kyoo:
  db:
  metadata:
  search:

.env

# vi: ft=sh
# shellcheck disable=SC2034
 
 
# Useful config options
 
# Library root can either be an absolute path or a relative path to your docker-compose.yml file.
LIBRARY_ROOT=./video
# You should set this to a path where kyoo can write large amount of data, this is used as a cache by the transcoder.
# It will automatically be cleaned up on kyoo's startup/shutdown/runtime.
CACHE_ROOT=/tmp/kyoo_cache
LIBRARY_LANGUAGES=en
# A pattern (regex) to ignore video files.
LIBRARY_IGNORE_PATTERN=".*/[dD]ownloads?/.*"
 
# If this is true, new accounts wont have any permissions before you approve them in your admin dashboard.
REQUIRE_ACCOUNT_VERIFICATION=true
# Specify permissions of guest accounts, default is no permissions.
UNLOGGED_PERMISSIONS=
# but you can allow anyone to use your instance without account by doing:
# UNLOGGED_PERMISSIONS=overall.read,overall.play
# You can specify this to allow guests users to see your collection without behing able to play videos for example:
# UNLOGGED_PERMISSIONS=overall.read
 
# Specify permissions of new accounts.
DEFAULT_PERMISSIONS=overall.read,overall.play
 
# Hardware transcoding (equivalent of --profile docker compose option).
COMPOSE_PROFILES=cpu # cpu (no hardware acceleration) or vaapi or qsv or nvidia
# the preset used during transcode. faster means worst quality, you can probably use a slower preset with hwaccels
# warning: using vaapi hwaccel disable presets (they are not supported).
GOCODER_PRESET=fast
 
 
# The following value should be set to a random sequence of characters.
# You MUST change it when installing kyoo (for security)
# You can input multiple api keys separated by a ,
KYOO_APIKEYS=t7H5!@4iMNsAaSJQ49pat4jprJgTcF656if#J3
 
# Keep those empty to use kyoo's default api key. You can also specify a custom API key if you want.
# go to https://www.themoviedb.org/settings/api and copy the api key (not the read access token, the api key)
THEMOVIEDB_APIKEY=
# go to https://thetvdb.com/api-information/signup and copy the api key
TVDB_APIKEY=
# you can also input your subscriber's pin to support TVDB
TVDB_PIN=
 
 
# The url you can use to reach your kyoo instance. This is used during oidc to redirect users to your instance.
PUBLIC_URL=http://localhost:5000
 
# Use a builtin oidc service (google, discord, trakt, or simkl):
# When you create a client_id, secret combo you may be asked for a redirect url. You need to specify https://YOUR-PUBLIC-URL/api/auth/logged/YOUR-SERVICE-NAME
OIDC_DISCORD_CLIENTID=
OIDC_DISCORD_SECRET=
# Or add your custom one:
OIDC_SERVICE_NAME=YourPrettyName
OIDC_SERVICE_LOGO=https://url-of-your-logo.com
OIDC_SERVICE_CLIENTID=
OIDC_SERVICE_SECRET=
OIDC_SERVICE_AUTHORIZATION=https://url-of-the-authorization-endpoint-of-the-oidc-service.com/auth
OIDC_SERVICE_TOKEN=https://url-of-the-token-endpoint-of-the-oidc-service.com/token
OIDC_SERVICE_PROFILE=https://url-of-the-profile-endpoint-of-the-oidc-service.com/userinfo
OIDC_SERVICE_SCOPE="the list of scopes space separeted like email identity"
# Token authentication method as seen in https://openid.net/specs/openid-connect-core-1_0.html#ClientAuthentication
# Supported values: ClientSecretBasic (default) or ClientSecretPost
# If in doubt, leave this empty.
OIDC_SERVICE_AUTHMETHOD=ClientSecretBasic
# on the previous list, service is the internal name of your service, you can add as many as you want.
 
 
# Following options are optional and only useful for debugging.
 
# To debug the front end, you can set the following to an external backend
KYOO_URL=
 
# Database things
POSTGRES_USER=KyooUser
POSTGRES_PASSWORD=KyooPassword
POSTGRES_DB=kyooDB
POSTGRES_SERVER=postgres
POSTGRES_PORT=5432
 
# Read by the api container to know if it should run meilisearch's migrations/sync
# and download missing images. This is a good idea to only have one instance with this on
# Note: it does not run postgres migrations, use the migration container for that.
RUN_MIGRATIONS=true
 
MEILI_HOST="http://meilisearch:7700"
MEILI_MASTER_KEY="ghvjkgisbgkbgskegblfqbgjkebbhgwkjfb"
 
RABBITMQ_HOST=rabbitmq
RABBITMQ_PORT=5672
RABBITMQ_DEFAULT_USER=kyoo
RABBITMQ_DEFAULT_PASS=aohohunuhouhuhhoahothonseuhaoensuthoaentsuhha

Resources

Website: https://kyoo.zoriya.dev/

GitHub: https://github.com/zoriya/kyoo

GitHub Container Registry: https://github.com/zoriya/Kyoo/pkgs/container/kyoo_autosync

Configuration: https://github.com/zoriya/Kyoo/blob/master/INSTALLING.md