Add Jellyfin Service
This commit is contained in:
83
nomad_jobs/services/jellyfin/jellyfin.nomad.hcl
Normal file
83
nomad_jobs/services/jellyfin/jellyfin.nomad.hcl
Normal file
@@ -0,0 +1,83 @@
|
||||
locals {
|
||||
SUBDOMAIN = "jellyfin." // End with dot or leave blamk for root domain
|
||||
DOMAIN = "example.com"
|
||||
TRAEFIK_DOMAIN = "${local.SUBDOMAIN}${local.DOMAIN}"
|
||||
}
|
||||
|
||||
job "jellfyin" {
|
||||
datacenters = ["dc1"]
|
||||
type = "service"
|
||||
|
||||
group "application" {
|
||||
count = 1
|
||||
|
||||
network {
|
||||
mode = "host"
|
||||
port "httpIngress" { static = 8096 }
|
||||
port "serviceDiscovery" { static = 1900 }
|
||||
port "clientDiscovery" { static = 7359 }
|
||||
}
|
||||
|
||||
volume "jellyfin-cache" {
|
||||
type = "host"
|
||||
source = "jellyfinCache"
|
||||
}
|
||||
|
||||
volume "jellyfin-config" {
|
||||
type = "host"
|
||||
source = "jellyfinConfig"
|
||||
}
|
||||
|
||||
volume "jellyfin-data" {
|
||||
type = "host"
|
||||
source = "media"
|
||||
}
|
||||
|
||||
service {
|
||||
name = "jellyfin"
|
||||
port = "httpIngress"
|
||||
|
||||
tags = [
|
||||
"traefik.enable=true",
|
||||
"traefik.http.routers.jellyfin.tls=true",
|
||||
"traefik.http.routers.jellyfin.entrypoints=websecure",
|
||||
"traefik.http.routers.jellyfin.rule=Host(`${local.TRAEFIK_DOMAIN}`)"
|
||||
]
|
||||
|
||||
check {
|
||||
type = "http"
|
||||
path = "/health"
|
||||
interval = "10s"
|
||||
timeout = "2s"
|
||||
}
|
||||
}
|
||||
|
||||
task "jellyfin" {
|
||||
driver = "docker"
|
||||
|
||||
config {
|
||||
image = "jellyfin/jellyfin:2024030405"
|
||||
ports = ["httpIngress", "serviceDiscovery", "clientDiscovery"]
|
||||
}
|
||||
|
||||
env = {
|
||||
JELLYFIN_PublishedServerUrl="${local.TRAEFIK_DOMAIN}"
|
||||
}
|
||||
|
||||
volume_mount {
|
||||
volume = "jellyfin-cache"
|
||||
destination = "/cache"
|
||||
}
|
||||
|
||||
volume_mount {
|
||||
volume = "jellyfin-config"
|
||||
destination = "/config"
|
||||
}
|
||||
|
||||
volume_mount {
|
||||
volume = "jellyfin-data"
|
||||
destination = "/media"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user