- Remove postgresql-client installation (causes 150s+ hangs due to network) - Add db_init.py: Pure Python PostgreSQL checks using psycopg2-binary - Simplify startup.sh: Call Python script instead of psql commands - Build should now complete in <30s instead of hanging This fixes the deployment timeout issue by avoiding APT network problems entirely. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
20 lines
812 B
Bash
20 lines
812 B
Bash
#!/bin/bash
|
|
set -e
|
|
|
|
# Run database initialization with Python (no psql needed!)
|
|
python /app/db_init.py
|
|
|
|
if [ $? -ne 0 ]; then
|
|
echo "✗ Database initialization failed"
|
|
exit 1
|
|
fi
|
|
|
|
# ── Start Application ──────────────────────────────────────────
|
|
echo ""
|
|
echo "═══════════════════════════════════════════════════════════"
|
|
echo "Starting FastAPI application..."
|
|
echo "═══════════════════════════════════════════════════════════"
|
|
echo ""
|
|
|
|
exec uvicorn main:app --host 0.0.0.0 --port 8000
|