Harshit Ghosh commited on
Commit ·
20d5ed3
1
Parent(s): 3754bec
Fix 500: run db migrations in start.sh before gunicorn
Browse files
start.sh
CHANGED
|
@@ -8,6 +8,9 @@ CELERY_PID=$!
|
|
| 8 |
# Trap SIGTERM and SIGINT for graceful shutdown
|
| 9 |
trap "kill $CELERY_PID; exit 0" SIGTERM SIGINT
|
| 10 |
|
|
|
|
|
|
|
|
|
|
| 11 |
# Start Gunicorn in foreground
|
| 12 |
# Hugging Face Spaces expects the app to listen on port 7860
|
| 13 |
gunicorn -w 4 -b 0.0.0.0:${PORT:-7860} app_new:app
|
|
|
|
| 8 |
# Trap SIGTERM and SIGINT for graceful shutdown
|
| 9 |
trap "kill $CELERY_PID; exit 0" SIGTERM SIGINT
|
| 10 |
|
| 11 |
+
# Run database migrations/initialization
|
| 12 |
+
flask --app app_new init-db-cmd
|
| 13 |
+
|
| 14 |
# Start Gunicorn in foreground
|
| 15 |
# Hugging Face Spaces expects the app to listen on port 7860
|
| 16 |
gunicorn -w 4 -b 0.0.0.0:${PORT:-7860} app_new:app
|