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>
10 lines
180 B
Bash
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
|