Skip to content

fix(selfhost): add a healthcheck to the ollama service #2504

Description

@JSONbored

Parent: #1936

Problem

The ollama service in docker-compose.yml has no healthcheck: block, so no dependent service can gate on it via condition: service_healthy, unlike every other optional backend (qdrant, postgres, tempo, the backup-exporter all have one).

Operators following the in-file instructions (--profile ollama then set AI_PROVIDER=ollama/OLLAMA_AI_BASE_URL in .env) get no compose-level signal that Ollama has finished starting and is accepting API calls before the app starts using it; first review requests after a fresh up can hit connection-refused with only the app's own retry/error-handling as a safety net, and there is no way to add a depends_on: ollama: condition: service_healthy gate even if desired later.

Fix

Add a healthcheck hitting Ollama's /api/tags endpoint (the image ships the ollama CLI, so CMD ["ollama", "list"] works without needing curl, or use a bash /dev/tcp probe like the existing qdrant healthcheck) so the service's state is visible via docker compose ps and can eventually be depended on.

Verification

  • Confirm current ollama service block against docker-compose.yml (line numbers may have shifted).
  • docker compose --profile ollama ps shows a health status for ollama, not "no healthcheck".

Metadata

Metadata

Assignees

No one assigned

    Labels

    gittensor:featureGittensor-scored feature linked to a feature issue — scores a 0.25x multiplier.

    Projects

    Status
    Done

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions