corvid/entrypoint.sh
Kevin Welvaert ATA IT 80a6c1e140 fix: wait for postgres before running migrations on startup
App was crash-looping when the host restarted and Docker brought up the
app container before postgres was ready. Added a pg_isready poll loop in
entrypoint.sh and installed postgresql-client in the image.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-27 09:12:08 +02:00

10 lines
180 B
Bash

#!/bin/sh
set -e
until pg_isready -q -h postgres; do
echo "Waiting for postgres..."
sleep 2
done
alembic upgrade head
exec uvicorn corvid.main:app --host 0.0.0.0 --port 8080