Skip to content

fix(infra): remove broken wget healthcheck override for media-server#2004

Open
sgsimpson wants to merge 1 commit into
CapSoftware:mainfrom
sgsimpson:main
Open

fix(infra): remove broken wget healthcheck override for media-server#2004
sgsimpson wants to merge 1 commit into
CapSoftware:mainfrom
sgsimpson:main

Conversation

@sgsimpson

@sgsimpson sgsimpson commented Jul 13, 2026

Copy link
Copy Markdown

Problem

cap-media-server reports unhealthy in every docker-compose based deployment (docker-compose.yml, docker-compose.coolify.yml, docker-compose.template.yml), even though the service itself is fully functional. Querying /health directly (e.g. from another container on the same network) returns:

{"status":"ok","mediaEngine":{"available":true,...},"ffmpeg":{"available":true,...}}

Root cause

The compose healthcheck: for media-server shells out to wget:

healthcheck:
  test: ["CMD", "wget", "-qO-", "http://localhost:3456/health"]

but apps/media-server/Dockerfile is FROM oven/bun:1, which never installs wget. Every healthcheck invocation fails immediately:

OCI runtime exec failed: exec: "wget": executable file not found in $PATH

This permanently marks the container unhealthy regardless of actual application state — including for anything downstream that keys off container health (depends_on: condition: service_healthy, monitoring/alerting, etc.).

The Dockerfile already defines a correct healthcheck:

HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \
	CMD ["bun", "-e", "const response = await fetch(`http://localhost:${process.env.PORT || 3456}/health`); process.exit(response.ok ? 0 : 1)"]

but Compose's healthcheck: stanza overrides the image's built-in HEALTHCHECK rather than falling back to it, so this correct check never runs for anyone deploying via any of the three compose files.

Fix

Remove the redundant, broken healthcheck: override for media-server from all three compose files, so each deployment inherits the image's own correct HEALTHCHECK instead of duplicating (and silently breaking) the same logic in three places.

Testing

Applied this change against a running self-hosted instance and recreated the media-server container:

$ docker inspect cap-media-server --format '{{json .Config.Healthcheck}}'
{"Test":["CMD","bun","-e","...fetch(...)..."],...}

$ docker ps --filter name=cap-media-server
cap-media-server   Up 55 seconds (healthy)

Confirmed healthy and stable over multiple check intervals (FailingStreak: 0), with no other Cap services affected.

Greptile Summary

This PR lets the media server use its image-defined healthcheck. The main changes are:

  • Removed the wget healthcheck override from docker-compose.yml.
  • Removed the same override from docker-compose.coolify.yml.
  • Removed the same override from docker-compose.template.yml.

Confidence Score: 5/5

This looks safe to merge.

  • No blocking issues found in the changed code.
  • The inherited media-server healthcheck exists on the relevant image build path and uses the configured port.
  • No compose service currently waits on media-server health for startup ordering.

Important Files Changed

Filename Overview
docker-compose.yml Removes the local media-server healthcheck override so the standalone Dockerfile healthcheck is used.
docker-compose.coolify.yml Removes the Coolify media-server healthcheck override so the prebuilt image healthcheck is used.
docker-compose.template.yml Removes the template media-server healthcheck override so deployments avoid the missing wget check.

Reviews (1): Last reviewed commit: "fix(infra): remove broken wget healthche..." | Re-trigger Greptile

Context used:

  • Context used - CLAUDE.md (source)
  • Context used - AGENTS.md (source)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant