Initial commit

This commit is contained in:
bvandeusen
2025-07-28 21:57:49 +00:00
commit d200550b35
41 changed files with 591 additions and 0 deletions
+22
View File
@@ -0,0 +1,22 @@
#!/bin/bash
# Wait for the database to be ready (timeout after 3 minutes)
MAX_WAIT=180 # seconds
WAIT_INTERVAL=2
WAITED=0
until pg_isready -h "$DB_HOST" -p "$DB_PORT" -U "$DB_USER" > /dev/null 2>&1; do
if [ $WAITED -ge $MAX_WAIT ]; then
echo "Timeout: Could not connect to the database at $DB_HOST:$DB_PORT within $MAX_WAIT seconds."
exit 1
fi
echo "Waiting for database at $DB_HOST:$DB_PORT... ($WAITED/$MAX_WAIT seconds)"
sleep $WAIT_INTERVAL
WAITED=$((WAITED + WAIT_INTERVAL))
done
echo "Database is ready. Applying migrations..."
flask db upgrade
echo "Starting Flask app..."
exec flask run --host=0.0.0.0 --port=5000