ashwinR commited on
Commit
4378bc0
·
1 Parent(s): 88dfa3e

Update start.sh

Browse files
Files changed (1) hide show
  1. start.sh +6 -7
start.sh CHANGED
@@ -1,14 +1,13 @@
1
  #!/bin/bash
2
 
3
- # Start Redis
4
- service redis-server start
5
-
6
- # Start PostgreSQL
7
- service postgresql start
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