dotfiles/terranix/containers/jellyfin/job.hcl
magic_rb e4e40ee7bc
Give more memory to jellyfin
Signed-off-by: magic_rb <magic_rb@redalder.org>
2023-11-25 18:33:14 +01:00

115 lines
2.1 KiB
HCL

job "jellyfin" {
datacenters = [ "homelab-1" ]
type = "service"
constraint {
attribute = "${attr.unique.hostname}"
value = "blowhole"
}
group "jellyfin" {
count = 1
volume "jellyfin-cache" {
type = "csi"
source = "jellyfin-cache"
read_only = false
attachment_mode = "file-system"
access_mode = "single-node-writer"
}
volume "jellyfin-config" {
type = "csi"
source = "jellyfin-config"
read_only = false
attachment_mode = "file-system"
access_mode = "single-node-writer"
}
volume "jellyfin-media" {
type = "host"
read_only = true
source = "jellyfin-media"
}
network {
mode = "bridge"
port "http" {
to = 8096
}
}
service {
name = "jellyfin"
port = "8096"
check {
type = "http"
address_mode = "alloc"
path = "/"
port = "8096"
interval = "10s"
timeout = "10s"
}
connect {
sidecar_service {}
sidecar_task {
resources {
cpu = 75
memory = 48
memory_max = 96
}
}
}
}
task "jellyfin" {
driver = "docker"
config {
image = "jellyfin/jellyfin@sha256:08900f012d66d2cfed7cfa2343ea5a05ba8e8c487ef565738e96eb4acb3082ac"
# devices = [
# {
# host_path = "/dev/dri/renderD128"
# container_path = "/dev/dri/renderD128"
# },
# {
# host_path = "/dev/dri/card0"
# container_path = "/dev/dri/card0"
# }
# ]
}
resources {
cpu = 1024
memory = 1536
memory_max = 3072
}
volume_mount {
volume = "jellyfin-cache"
destination = "/cache"
read_only = false
}
volume_mount {
volume = "jellyfin-config"
destination = "/config"
read_only = false
}
volume_mount {
volume = "jellyfin-media"
destination = "/media"
read_only = true
}
}
}
}