fix: send Authorization header in NodeLink healthcheck

NodeLink requires the Authorization header on every API route,
including /version, so the healthcheck's unauthenticated fetch always
got a 401 and the container stayed permanently unhealthy. Traefik
skips unhealthy containers, so the assigned domain returned a
sustained 404 even though the deploy finished successfully.

Pass the container's NODELINK_SERVER_PASSWORD as the Authorization
header in the healthcheck fetch; the container now reaches a healthy
state and the domain routes to the server (401 on / without
credentials, 200 on /version with the password), as expected for a
Lavalink-compatible server.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
Mauricio Siu
2026-07-08 01:49:54 -06:00
parent cbc0a9f242
commit ef8071e5ff

View File

@@ -23,7 +23,7 @@ services:
test:
[
"CMD-SHELL",
"node -e \"fetch('http://127.0.0.1:2333/version').then(r=>process.exit(r.ok?0:1)).catch(()=>process.exit(1))\"",
"node -e \"fetch('http://127.0.0.1:2333/version',{headers:{authorization:process.env.NODELINK_SERVER_PASSWORD||''}}).then(r=>process.exit(r.ok?0:1)).catch(()=>process.exit(1))\"",
]
interval: 30s
timeout: 10s