From 54aaa511d5672b1f742a89f95b495fb5e8d9fba2 Mon Sep 17 00:00:00 2001 From: Samuel Date: Mon, 22 Jul 2024 09:20:16 +0300 Subject: [PATCH] feat: add jellyfin template --- templates/jellyfin/docker-compose.yml | 15 +++++++++------ templates/jellyfin/index.ts | 5 ++++- 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/templates/jellyfin/docker-compose.yml b/templates/jellyfin/docker-compose.yml index b1af0ef71..bdfcf2615 100644 --- a/templates/jellyfin/docker-compose.yml +++ b/templates/jellyfin/docker-compose.yml @@ -1,17 +1,17 @@ version: '3.8' services: jellyfin: - image: jellyfin/jellyfin + image: jellyfin/jellyfin:10 networks: - dokploy-network labels: - "traefik.enable=true" - "traefik.http.routers.${HASH}.rule=Host(`${JELLYFIN_HOST}`)" - - "traefik.http.services.${HASH}.loadbalancer.server.port" + - "traefik.http.services.${HASH}.loadbalancer.server.port=${JELLYFIN_PORT}" volumes: - - ./config:/config - - ./cache:/cache - - ./media:/media + - config:/config + - cache:/cache + - media:/media restart: 'unless-stopped' # Optional - alternative address used for autodiscovery environment: @@ -19,7 +19,10 @@ services: # Optional - may be necessary for docker healthcheck to pass if running in host network mode extra_hosts: - 'host.docker.internal:host-gateway' - +volumes: + config: + cache: + media: networks: dokploy-network: external: true diff --git a/templates/jellyfin/index.ts b/templates/jellyfin/index.ts index 7af9884f8..61bd0f08b 100644 --- a/templates/jellyfin/index.ts +++ b/templates/jellyfin/index.ts @@ -7,10 +7,13 @@ import { } from "../utils"; export function generate(schema: Schema): Template { + const mainServiceHash = generateHash(schema.projectName); const randomDomain = generateRandomDomain(schema); - + const port = 8096; const envs = [ `JELLYFIN_HOST=${randomDomain}`, + `HASH=${mainServiceHash}`, + `JELLYFIN_PORT=${port}` ]; return {