Skip to content

fix(compose): gate backend startup on TCP-ready PostgreSQL - #6

Open
kpool-std-tideline-pilot[bot] wants to merge 2 commits into
codex/eval-web-1342-80720aa59aaffrom
kpool/changes/caa18f63db443fe4c7ec597a6875fb0690aed307fed43fdc6c4897db6b6e14f3
Open

kpool-std-tideline-pilot[bot] wants to merge 2 commits into
codex/eval-web-1342-80720aa59aaffrom
kpool/changes/caa18f63db443fe4c7ec597a6875fb0690aed307fed43fdc6c4897db6b6e14f3

Conversation

@kpool-std-tideline-pilot

Copy link
Copy Markdown

Problem: the backend could start when PostgreSQL was reachable only via its Unix socket (socket_only scenario), then fail database-backed requests.

Fix (docker-compose.yml only):

  • db: add a healthcheck using pg_isready -h 127.0.0.1 -p 5432, which forces a TCP probe. A socket-only server is reported unhealthy.
  • backend: change depends_on to long form with condition: service_healthy so the API container is not started until the DB accepts TCP connections. If the DB never accepts TCP, the API is never started and compose exposes the failure.

All other services, labels, networks, volumes and environment expressions are unchanged. No tests were run.

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.

0 participants