add jellyfin docker stack

add nfs shares for jellyfin
have 3 replicas of cyberchef
This commit is contained in:
Pim Kunis 2024-02-12 22:30:29 +01:00
parent 8201a613a9
commit cdcb7d93b9
5 changed files with 67 additions and 0 deletions

View file

@ -16,3 +16,4 @@
- {role: syncthing, tags: syncthing} - {role: syncthing, tags: syncthing}
- {role: kitchenowl, tags: kitchenowl} - {role: kitchenowl, tags: kitchenowl}
- {role: paperless-ngx, tags: paperless-ngx} - {role: paperless-ngx, tags: paperless-ngx}
- {role: jellyfin, tags: jellyfin}

View file

@ -11,6 +11,7 @@ services:
networks: networks:
- traefik - traefik
deploy: deploy:
replicas: 3
labels: labels:
- traefik.enable=true - traefik.enable=true
- traefik.http.routers.cyberchef.entrypoints=websecure - traefik.http.routers.cyberchef.entrypoints=websecure

View file

@ -0,0 +1,56 @@
# vi: ft=yaml
version: '3.5'
networks:
traefik:
external: true
volumes:
media:
driver_opts:
type: "nfs"
o: "addr=lewis.dmz,nolock,soft,rw"
device: ":/mnt/data/nfs/media"
config:
driver_opts:
type: "nfs"
o: "addr=lewis.dmz,nolock,soft,rw"
device: ":/mnt/data/nfs/jellyfin/config"
cache:
services:
jellyfin:
image: jellyfin/jellyfin
# user: uid:gid
network_mode: 'host'
volumes:
- cache:/cache
- type: volume
source: config
target: /config
volume:
nocopy: true
- type: volume
source: media
target: /media
volume:
nocopy: true
# - /path/to/media2:/media2:ro
# Optional - alternative address used for autodiscovery
environment:
- JELLYFIN_PublishedServerUrl=http://media.kun.is:444
# Optional - may be necessary for docker healthcheck to pass if running in host network mode
# extra_hosts:
# - "host.docker.internal:host-gateway"
networks:
- traefik
deploy:
labels:
- traefik.enable=true
- traefik.http.routers.jellyfin.entrypoints=localsecure
- traefik.http.routers.jellyfin.rule=Host(`media.kun.is`)
- traefik.http.routers.jellyfin.tls=true
- traefik.http.routers.jellyfin.tls.certresolver=letsencrypt
- traefik.http.routers.jellyfin.service=jellyfin
- traefik.http.services.jellyfin.loadbalancer.server.port=8096
- traefik.docker.network=traefik

View file

@ -0,0 +1,5 @@
- name: Deploy Docker stack
docker_stack:
name: jellyfin
compose:
- "{{ lookup('template', '{{ role_path }}/docker-stack.yml.j2') | from_yaml }}"

View file

@ -1,6 +1,7 @@
{ pkgs, lib, config, ... }: { pkgs, lib, config, ... }:
let let
cfg = config.lab.data-sharing; cfg = config.lab.data-sharing;
nfsShares = [ nfsShares = [
"/nextcloud/data" "/nextcloud/data"
"/radicale" "/radicale"
@ -15,7 +16,10 @@ let
"/syncthing/config" "/syncthing/config"
"/paperless-ngx/data" "/paperless-ngx/data"
"/paperless-ngx/redisdata" "/paperless-ngx/redisdata"
"/media"
"/jellyfin/config"
]; ];
nfsExports = lib.strings.concatLines ( nfsExports = lib.strings.concatLines (
builtins.map builtins.map
(share: (share: