Skip to content

fix(selfhost): gate gittensory's depends_on on postgres/pgbouncer health #2500

Description

@JSONbored

Parent: #1936

Problem

The core gittensory service's depends_on in docker-compose.yml only gates on redis and qdrant (condition: service_healthy) — it never depends on postgres or pgbouncer, even though --profile postgres/--profile pgbouncer are documented first-class deployment modes.

On docker compose --profile postgres up -d (or --profile pgbouncer) with a cold Postgres volume, Docker starts gittensory immediately in parallel with postgres initdb instead of waiting for the healthcheck. The app's own waitForPostgres() fallback (src/server.ts, ~30s hard cap) then races the Postgres image pull + first-run initialization; on a slow disk/first pull this commonly exceeds 30s, causing gittensory to throw and crash-loop via restart: unless-stopped before Postgres becomes reachable, rather than compose holding it back cleanly.

Fix

Add postgres: condition: service_healthy, required: false (and pgbouncer: condition: service_healthy, required: false) to the gittensory service's depends_on block, mirroring the existing qdrant pattern, so compose-level ordering covers the Postgres/PgBouncer path the same way it already covers Qdrant.

Verification

  • Confirm current depends_on block against docker-compose.yml (line numbers may have shifted).
  • docker compose --profile postgres up -d and docker compose --profile pgbouncer up -d from a cold volume no longer crash-loop the core app on first boot.
  • Confirm required: false correctly keeps the default (no-profile) SQLite path unaffected.

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