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
All checks were successful
Build and Push Docker Image / build-and-push (push) Successful in 36s
This commit is contained in:
@@ -31,9 +31,4 @@ proxy:
|
|||||||
- "*.jpg"
|
- "*.jpg"
|
||||||
- "*.jpeg"
|
- "*.jpeg"
|
||||||
- "*.gif"
|
- "*.gif"
|
||||||
- "*.svg"
|
- "*.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'"
|
|
||||||
@@ -31,10 +31,6 @@ job "navidrome-litefs" {
|
|||||||
static = 20202
|
static = 20202
|
||||||
to = 20202 # Maps host 20202 to container 20202 (LiteFS Replication)
|
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" {
|
task "navidrome" {
|
||||||
@@ -43,7 +39,7 @@ job "navidrome-litefs" {
|
|||||||
config {
|
config {
|
||||||
image = "gitea.service.dc1.fbleagh.duckdns.org/sstent/navidrome-litefs:latest"
|
image = "gitea.service.dc1.fbleagh.duckdns.org/sstent/navidrome-litefs:latest"
|
||||||
privileged = true # Still needed for FUSE
|
privileged = true # Still needed for FUSE
|
||||||
ports = ["http", "litefs", "health"]
|
ports = ["http", "litefs"]
|
||||||
|
|
||||||
volumes = [
|
volumes = [
|
||||||
"/mnt/configs/navidrome_litefs:/var/lib/litefs",
|
"/mnt/configs/navidrome_litefs:/var/lib/litefs",
|
||||||
@@ -58,7 +54,7 @@ job "navidrome-litefs" {
|
|||||||
# LiteFS Config
|
# LiteFS Config
|
||||||
CONSUL_URL = "http://${attr.unique.network.ip-address}:8500"
|
CONSUL_URL = "http://${attr.unique.network.ip-address}:8500"
|
||||||
ADVERTISE_IP = "${attr.unique.network.ip-address}"
|
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
|
# Navidrome Config
|
||||||
ND_DATAFOLDER = "/local/data"
|
ND_DATAFOLDER = "/local/data"
|
||||||
@@ -91,11 +87,11 @@ job "navidrome-litefs" {
|
|||||||
port = "http"
|
port = "http"
|
||||||
|
|
||||||
check {
|
check {
|
||||||
type = "http"
|
type = "script"
|
||||||
port = "health"
|
command = "/bin/sh"
|
||||||
path = "/"
|
args = ["-c", "/usr/local/bin/litefs is-primary"]
|
||||||
interval = "10s"
|
interval = "10s"
|
||||||
timeout = "2s"
|
timeout = "5s"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -105,4 +101,4 @@ job "navidrome-litefs" {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user