diff --git a/nomad-jobs/media-stack.nomad.hcl b/nomad-jobs/media-stack.nomad.hcl new file mode 100644 index 0000000..9a6bd5d --- /dev/null +++ b/nomad-jobs/media-stack.nomad.hcl @@ -0,0 +1,424 @@ +# Media Stack - hobbs.farm +# Services: Jellyfin, Sonarr, Radarr, SABnzbd, NZBHydra2, Jellyseerr +# Deploy: nomad job run media-stack.nomad.hcl + +job "media-stack" { + datacenters = ["hf-dc1"] + type = "service" + + # Jellyfin - Media Server + group "jellyfin" { + count = 1 + + network { + port "http" { static = 8096 } + } + + volume "config" { + type = "host" + source = "jellyfin-config" + read_only = false + } + + volume "media" { + type = "host" + source = "media" + read_only = false + } + + service { + name = "jellyfin" + port = "http" + + tags = [ + "traefik.enable=true", + "traefik.http.routers.jellyfin.rule=Host(`r2d2.hobbs.farm`)", + "traefik.http.routers.jellyfin.entrypoints=websecure", + "traefik.http.routers.jellyfin.tls.certresolver=letsencrypt", + ] + + check { + type = "http" + path = "/health" + interval = "30s" + timeout = "5s" + } + } + + task "jellyfin" { + driver = "docker" + + config { + image = "jellyfin/jellyfin:latest" + ports = ["http"] + } + + volume_mount { + volume = "config" + destination = "/config" + } + + volume_mount { + volume = "media" + destination = "/media" + } + + env { + JELLYFIN_PublishedServerUrl = "https://r2d2.hobbs.farm" + } + + resources { + cpu = 2000 + memory = 2048 + } + } + } + + # Sonarr - TV Show Management + group "sonarr" { + count = 1 + + network { + port "http" { static = 8989 } + } + + volume "config" { + type = "host" + source = "sonarr-config" + read_only = false + } + + volume "media" { + type = "host" + source = "media" + read_only = false + } + + volume "downloads" { + type = "host" + source = "downloads" + read_only = false + } + + service { + name = "sonarr" + port = "http" + + tags = [ + "traefik.enable=true", + "traefik.http.routers.sonarr.rule=Host(`sonarr.hobbs.farm`)", + "traefik.http.routers.sonarr.entrypoints=websecure", + "traefik.http.routers.sonarr.tls.certresolver=letsencrypt", + ] + + check { + type = "http" + path = "/ping" + interval = "30s" + timeout = "5s" + } + } + + task "sonarr" { + driver = "docker" + + config { + image = "linuxserver/sonarr:latest" + ports = ["http"] + } + + volume_mount { + volume = "config" + destination = "/config" + } + + volume_mount { + volume = "media" + destination = "/media" + } + + volume_mount { + volume = "downloads" + destination = "/downloads" + } + + env { + PUID = "1000" + PGID = "1000" + TZ = "America/Chicago" + } + + resources { + cpu = 500 + memory = 512 + } + } + } + + # Radarr - Movie Management + group "radarr" { + count = 1 + + network { + port "http" { static = 7878 } + } + + volume "config" { + type = "host" + source = "radarr-config" + read_only = false + } + + volume "media" { + type = "host" + source = "media" + read_only = false + } + + volume "downloads" { + type = "host" + source = "downloads" + read_only = false + } + + service { + name = "radarr" + port = "http" + + tags = [ + "traefik.enable=true", + "traefik.http.routers.radarr.rule=Host(`radarr.hobbs.farm`)", + "traefik.http.routers.radarr.entrypoints=websecure", + "traefik.http.routers.radarr.tls.certresolver=letsencrypt", + ] + + check { + type = "http" + path = "/ping" + interval = "30s" + timeout = "5s" + } + } + + task "radarr" { + driver = "docker" + + config { + image = "linuxserver/radarr:latest" + ports = ["http"] + } + + volume_mount { + volume = "config" + destination = "/config" + } + + volume_mount { + volume = "media" + destination = "/media" + } + + volume_mount { + volume = "downloads" + destination = "/downloads" + } + + env { + PUID = "1000" + PGID = "1000" + TZ = "America/Chicago" + } + + resources { + cpu = 500 + memory = 512 + } + } + } + + # SABnzbd - Usenet Downloader + group "sabnzbd" { + count = 1 + + network { + port "http" { static = 8082 } + } + + volume "config" { + type = "host" + source = "sabnzbd-config" + read_only = false + } + + volume "downloads" { + type = "host" + source = "downloads" + read_only = false + } + + service { + name = "sabnzbd" + port = "http" + + tags = [ + "traefik.enable=true", + "traefik.http.routers.sabnzbd.rule=Host(`sabnzbd.hobbs.farm`)", + "traefik.http.routers.sabnzbd.entrypoints=websecure", + "traefik.http.routers.sabnzbd.tls.certresolver=letsencrypt", + ] + + check { + type = "http" + path = "/" + interval = "30s" + timeout = "5s" + } + } + + task "sabnzbd" { + driver = "docker" + + config { + image = "linuxserver/sabnzbd:latest" + ports = ["http"] + } + + volume_mount { + volume = "config" + destination = "/config" + } + + volume_mount { + volume = "downloads" + destination = "/downloads" + } + + env { + PUID = "1000" + PGID = "1000" + TZ = "America/Chicago" + } + + resources { + cpu = 500 + memory = 512 + } + } + } + + # NZBHydra2 - Indexer Manager + group "nzbhydra2" { + count = 1 + + network { + port "http" { static = 5076 } + } + + volume "config" { + type = "host" + source = "nzbhydra2-config" + read_only = false + } + + service { + name = "nzbhydra2" + port = "http" + + tags = [ + "traefik.enable=true", + "traefik.http.routers.nzbhydra2.rule=Host(`hydra.hobbs.farm`)", + "traefik.http.routers.nzbhydra2.entrypoints=websecure", + "traefik.http.routers.nzbhydra2.tls.certresolver=letsencrypt", + ] + + check { + type = "http" + path = "/" + interval = "30s" + timeout = "5s" + } + } + + task "nzbhydra2" { + driver = "docker" + + config { + image = "linuxserver/nzbhydra2:latest" + ports = ["http"] + } + + volume_mount { + volume = "config" + destination = "/config" + } + + env { + PUID = "1000" + PGID = "1000" + TZ = "America/Chicago" + } + + resources { + cpu = 300 + memory = 256 + } + } + } + + # Jellyseerr - Media Request Manager + group "jellyseerr" { + count = 1 + + network { + port "http" { static = 5055 } + } + + volume "config" { + type = "host" + source = "jellyseerr-config" + read_only = false + } + + service { + name = "jellyseerr" + port = "http" + + tags = [ + "traefik.enable=true", + "traefik.http.routers.jellyseerr.rule=Host(`requests.hobbs.farm`)", + "traefik.http.routers.jellyseerr.entrypoints=websecure", + "traefik.http.routers.jellyseerr.tls.certresolver=letsencrypt", + ] + + check { + type = "http" + path = "/api/v1/status" + interval = "30s" + timeout = "5s" + } + } + + task "jellyseerr" { + driver = "docker" + + config { + image = "fallenbagel/jellyseerr:latest" + ports = ["http"] + } + + volume_mount { + volume = "config" + destination = "/app/config" + } + + env { + TZ = "America/Chicago" + } + + resources { + cpu = 300 + memory = 512 + } + } + } +}