| 1 | amends "../../config/Service.pkl" |
| 2 | |
| 3 | import "../../config/site.pkl" as site |
| 4 | import "../keycloak/service.pkl" as keycloak |
| 5 | |
| 6 | meta { name = "Jellyfin" } |
| 7 | // SQLite under /config requires one writer during rollout. |
| 8 | rollout = "simple" |
| 9 | healthyDeadline = "20m" |
| 10 | healthRestartGrace = "20m" |
| 11 | prepare = "prepare.py" |
| 12 | setup = "configure.py" |
| 13 | |
| 14 | secrets { ["admin_password"] {} } |
| 15 | |
| 16 | requirements { |
| 17 | new keycloak.OpenIDClient { |
| 18 | clientId = module.id |
| 19 | name = module.meta.name |
| 20 | } |
| 21 | } |
| 22 | |
| 23 | container { |
| 24 | image = "docker.io/jellyfin/jellyfin@sha256:aefb67e6a7ff1debdd154a78a7bbb780fd0c873d8639210a7f6a2016ad2b35db" |
| 25 | cpu = 500 |
| 26 | memory = 3072 |
| 27 | extraHosts { "\(keycloak.container.http.hostname):host-gateway" } |
| 28 | |
| 29 | http { |
| 30 | containerPort = 8096 |
| 31 | subdomain = "jelly" |
| 32 | checkPath = "/health" |
| 33 | metricsPath = "/metrics" |
| 34 | overrideFiles { ["/web/extra/"] = "theme" } |
| 35 | headHtml { |
| 36 | ["/web/"] = "<link rel=\"stylesheet\" href=\"/web/extra/theme.css\">" |
| 37 | ["/web/index.html"] = "<link rel=\"stylesheet\" href=\"/web/extra/theme.css\">" |
| 38 | } |
| 39 | } |
| 40 | |
| 41 | volumes { |
| 42 | ["/config"] {} |
| 43 | ["/cache"] {} |
| 44 | for (name, folder in site.jellyfinFolders) { |
| 45 | ["/media/jellyfin/\(name)"] { src = "\(site.mediaRoot)/\(folder)"; readOnly = true } |
| 46 | } |
| 47 | ["/config/config/branding.xml"] { config = "branding.xml" } |
| 48 | ["/etc/ssl/certs/ca-certificates.crt"] { |
| 49 | src = "/var/lib/studio/ca-bundle.crt" |
| 50 | readOnly = true |
| 51 | } |
| 52 | } |
| 53 | |
| 54 | env { |
| 55 | ["JELLYFIN_PublishedServerUrl"] = "https://\(module.container.http.hostname)" |
| 56 | } |
| 57 | } |