homelab/nomad-job/jellyfin.nomad

120 lines
3.1 KiB
Plaintext
Raw Normal View History

2022-08-07 08:59:39 +00:00
job "jellyfin" {
datacenters = ["homelab"]
2023-09-14 18:27:06 +00:00
priority = 30
2022-10-29 08:40:01 +00:00
type = "service"
2024-02-21 18:03:31 +00:00
2022-08-07 08:59:39 +00:00
meta {
2023-08-30 18:54:47 +00:00
forcedeploy = "1"
2022-08-07 08:59:39 +00:00
}
constraint {
attribute = "${attr.cpu.arch}"
2022-10-29 08:40:01 +00:00
value = "amd64"
2022-08-07 08:59:39 +00:00
}
2024-02-21 18:03:31 +00:00
constraint {
attribute = "${node.class}"
operator = "set_contains"
value = "cluster"
}
2023-09-21 18:27:27 +00:00
group jellyfin-vue {
2023-08-30 18:54:47 +00:00
network {
2023-09-21 18:27:27 +00:00
mode = "host"
port "http" {
to = 80
}
2023-08-30 18:54:47 +00:00
}
2023-09-21 18:27:27 +00:00
task "jellyfin-vue" {
driver = "docker"
service {
name = "jellyfin-vue"
port = "http"
tags = [
"homer.enable=true",
"homer.name=${NOMAD_TASK_NAME}",
"homer.service=Application",
"homer.target=_blank",
2023-11-05 18:08:17 +00:00
"homer.logo=https://${NOMAD_TASK_NAME}.ducamps.eu/icon.png",
"homer.url=https://${NOMAD_TASK_NAME}.ducamps.eu",
2023-09-21 18:27:27 +00:00
"traefik.enable=true",
2023-11-05 18:08:17 +00:00
"traefik.http.routers.${NOMAD_TASK_NAME}.rule=Host(`${NOMAD_TASK_NAME}.ducamps.eu`)",
"traefik.http.routers.${NOMAD_TASK_NAME}.tls.domains[0].sans=${NOMAD_TASK_NAME}.ducamps.eu",
2023-09-21 18:27:27 +00:00
"traefik.http.routers.${NOMAD_TASK_NAME}.tls.certresolver=myresolver",
2023-10-07 16:40:40 +00:00
"traefik.http.routers.${NOMAD_TASK_NAME}.entrypoints=web,websecure",
2023-09-21 18:27:27 +00:00
]
2023-08-30 18:54:47 +00:00
2023-09-21 18:27:27 +00:00
}
config {
2024-03-17 17:58:24 +00:00
image = "ghcr.service.consul:5000/jellyfin/jellyfin-vue:unstable"
2023-09-21 18:27:27 +00:00
ports = ["http"]
}
env {
2023-11-05 18:08:17 +00:00
DEFAULT_SERVERS = "${NOMAD_TASK_NAME}.ducamps.eu"
2023-09-21 18:27:27 +00:00
}
2022-08-07 08:59:39 +00:00
2023-09-21 18:27:27 +00:00
resources {
2023-08-30 18:54:47 +00:00
2023-09-21 18:27:27 +00:00
memory = 50
cpu = 100
}
2023-08-30 18:54:47 +00:00
}
}
2022-10-29 08:40:01 +00:00
group "jellyfin" {
2022-08-07 08:59:39 +00:00
network {
mode = "host"
port "http" {
2022-10-29 08:40:01 +00:00
to = 8096
2022-08-07 08:59:39 +00:00
}
}
task "jellyfin" {
driver = "docker"
service {
name = "jellyfin"
port = "http"
2022-10-29 08:40:01 +00:00
tags = [
2022-08-10 17:31:23 +00:00
"homer.enable=true",
"homer.name=jellyfin",
"homer.service=Application",
"homer.target=_blank",
2023-11-05 18:08:17 +00:00
"homer.logo=https://${NOMAD_JOB_NAME}.ducamps.eu/web/assets/img/banner-light.png",
"homer.url=https://${NOMAD_JOB_NAME}.ducamps.eu",
2022-08-10 17:31:23 +00:00
"traefik.enable=true",
2023-11-05 18:08:17 +00:00
"traefik.http.routers.${NOMAD_JOB_NAME}.rule=Host(`${NOMAD_JOB_NAME}.ducamps.eu`)",
"traefik.http.routers.${NOMAD_JOB_NAME}.tls.domains[0].sans=${NOMAD_JOB_NAME}.ducamps.eu",
2022-08-10 17:31:23 +00:00
"traefik.http.routers.${NOMAD_JOB_NAME}.tls.certresolver=myresolver",
2023-10-07 16:40:40 +00:00
"traefik.http.routers.${NOMAD_JOB_NAME}.entrypoints=web,websecure",
2022-08-07 08:59:39 +00:00
]
}
config {
2024-03-17 17:58:24 +00:00
image = "docker.service.consul:5000/jellyfin/jellyfin"
2022-08-07 08:59:39 +00:00
ports = ["http"]
volumes = [
"/mnt/diskstation/nomad/jellyfin/config:/config",
2022-08-10 17:32:01 +00:00
"/mnt/diskstation/nomad/jellyfin/cache:/cache",
2024-02-29 20:36:35 +00:00
"/mnt/diskstation/media:/media",
2024-02-24 16:11:12 +00:00
"/mnt/diskstation/music:/music",
2022-08-10 17:32:01 +00:00
]
devices = [
{
2022-10-29 08:40:01 +00:00
host_path = "/dev/dri/renderD128"
container_path = "/dev/dri/renderD128"
2022-08-10 17:32:01 +00:00
},
{
2022-10-29 08:40:01 +00:00
host_path = "/dev/dri/card0"
container_path = "/dev/dri/card0"
2022-08-10 17:32:01 +00:00
}
2022-08-07 08:59:39 +00:00
]
}
resources {
2023-09-21 18:27:27 +00:00
memory = 2000
memory_max = 4000
cpu = 3000
2022-08-07 08:59:39 +00:00
}
}
}
}