Spaces:
Build error
Build error
Update start.sh
Browse files
start.sh
CHANGED
@@ -1,14 +1,13 @@
|
|
1 |
#!/bin/bash
|
2 |
|
3 |
-
#
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
|
10 |
# Run migrations
|
11 |
alembic upgrade head
|
12 |
|
13 |
# Start the FastAPI app using Uvicorn
|
14 |
-
uvicorn app:app --host 0.0.0.0 --port 7860
|
|
|
1 |
#!/bin/bash
|
2 |
|
3 |
+
# Wait for PostgreSQL to become ready
|
4 |
+
while ! pg_isready -q -h localhost -p 5432 -U postadmin; do
|
5 |
+
echo "$(date) - waiting for database to start"
|
6 |
+
sleep 2
|
7 |
+
done
|
|
|
8 |
|
9 |
# Run migrations
|
10 |
alembic upgrade head
|
11 |
|
12 |
# Start the FastAPI app using Uvicorn
|
13 |
+
uvicorn app:app --host 0.0.0.0 --port 7860
|