Files
service-finder/backend/app/scripts/pre_start.sh
2026-03-22 11:02:05 +00:00

27 lines
773 B
Bash
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
#!/bin/bash
set -e
echo "🚀 Service Finder PreStart Schema Synchronization"
echo "=================================================="
# Ensure we are in the correct directory (should be /app inside container)
cd /app
# Override EMAIL_PROVIDER to smtp for development
export EMAIL_PROVIDER=smtp
# Run the unified database synchronizer with --apply flag
echo "📦 Running unified_db_sync.py --apply..."
python -m app.scripts.unified_db_sync --apply
# Verify that the sync succeeded
if [ $? -eq 0 ]; then
echo "✅ Schema synchronization completed successfully."
else
echo "❌ Schema synchronization failed. Exiting."
exit 1
fi
# Start the FastAPI application
echo "🌐 Starting FastAPI server..."
exec uvicorn app.main:app --host 0.0.0.0 --port 8000