fix: use script check with sh -c for primary detection
All checks were successful
Build and Push Docker Image / build-and-push (push) Successful in 36s

This commit is contained in:
2026-02-07 18:03:28 -08:00
parent cd6a6efb80
commit a10a50a6ea
2 changed files with 8 additions and 17 deletions

View File

@@ -31,9 +31,4 @@ proxy:
- "*.jpg"
- "*.jpeg"
- "*.gif"
- "*.svg"
# Commands to run only on the primary node.
# This serves as a primary-only health check responder.
exec:
- cmd: "nc -lk -p 8082 -e echo -e 'HTTP/1.1 200 OK\r\nContent-Length: 7\r\n\r\nPrimary'"
- "*.svg"

View File

@@ -31,10 +31,6 @@ job "navidrome-litefs" {
static = 20202
to = 20202 # Maps host 20202 to container 20202 (LiteFS Replication)
}
port "health" {
static = 8082
to = 8082 # Handled by nc loop in litefs.yml exec
}
}
task "navidrome" {
@@ -43,7 +39,7 @@ job "navidrome-litefs" {
config {
image = "gitea.service.dc1.fbleagh.duckdns.org/sstent/navidrome-litefs:latest"
privileged = true # Still needed for FUSE
ports = ["http", "litefs", "health"]
ports = ["http", "litefs"]
volumes = [
"/mnt/configs/navidrome_litefs:/var/lib/litefs",
@@ -58,7 +54,7 @@ job "navidrome-litefs" {
# LiteFS Config
CONSUL_URL = "http://${attr.unique.network.ip-address}:8500"
ADVERTISE_IP = "${attr.unique.network.ip-address}"
PORT = "8080" # Internal proxy port (unused by direct routing but kept for image compat)
PORT = "8080" # Internal proxy port
# Navidrome Config
ND_DATAFOLDER = "/local/data"
@@ -91,11 +87,11 @@ job "navidrome-litefs" {
port = "http"
check {
type = "http"
port = "health"
path = "/"
type = "script"
command = "/bin/sh"
args = ["-c", "/usr/local/bin/litefs is-primary"]
interval = "10s"
timeout = "2s"
timeout = "5s"
}
}
@@ -105,4 +101,4 @@ job "navidrome-litefs" {
}
}
}
}
}