Skip to content

Fix postgres healthcheck: add start_period to prevent false unhealthy on fresh deploy#14

Merged
alankey-dev merged 2 commits intomainfrom
copilot/fix-deployment-failure
Mar 14, 2026
Merged

Fix postgres healthcheck: add start_period to prevent false unhealthy on fresh deploy#14
alankey-dev merged 2 commits intomainfrom
copilot/fix-deployment-failure

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 14, 2026

On fresh deployments, postgres fails its healthcheck before finishing initialization — it runs 8 migration scripts via docker-entrypoint-initdb.d, which can exceed the 50s window (5 retries × 10s) with no grace period, causing dependent api and router containers to abort.

Change

  • docker-compose.yml: Added start_period: 30s to the postgres healthcheck
healthcheck:
  test: ["CMD-SHELL", "pg_isready -U arcus -d arcus"]
  interval: 10s
  timeout: 5s
  retries: 5
  start_period: 30s  # added

start_period defers retry counting until postgres has had time to run migrations, so transient failures during init no longer consume the retry budget.


🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.

…itialization

Co-authored-by: Bigalan09 <800520+Bigalan09@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix deployment failure for bigalan09/arcus Fix postgres healthcheck: add start_period to prevent false unhealthy on fresh deploy Mar 14, 2026
Copilot AI requested a review from alankey-dev March 14, 2026 07:51
@alankey-dev alankey-dev marked this pull request as ready for review March 14, 2026 11:27
@alankey-dev alankey-dev merged commit f2f7859 into main Mar 14, 2026
3 checks passed
@alankey-dev alankey-dev deleted the copilot/fix-deployment-failure branch March 14, 2026 11:28
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.

2 participants