File size: 740 Bytes
26e1c2e | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 | #!/bin/bash
set -e
cd /app/murshid_backend
# Run Alembic migrations
echo "🔄 Running database migrations..."
python -m alembic upgrade head
echo "✅ Database ready"
# Import Excel templates (if not already imported)
echo "📊 Importing WQL templates from Excel..."
python -c "
from app.db.session import SessionLocal
from scripts.import_excel_templates import run as import_excel
db = SessionLocal()
try:
result = import_excel(db, replace=False)
print('Templates:', result)
finally:
db.close()
" || echo "⚠️ Template import skipped (non-critical)"
echo "🚀 Starting Murshid API on port ${PORT:-7860}..."
exec python -m uvicorn app.main:app \
--host 0.0.0.0 \
--port "${PORT:-7860}" \
--log-level info
|