Spaces:
Build error
Build error
Update start.sh
Browse files
start.sh
CHANGED
@@ -1,13 +1,24 @@
|
|
1 |
#!/bin/bash
|
2 |
|
3 |
-
#
|
4 |
-
|
5 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
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
|
|
|
1 |
#!/bin/bash
|
2 |
|
3 |
+
# Start Redis
|
4 |
+
service redis-server start
|
5 |
+
|
6 |
+
# Start PostgreSQL
|
7 |
+
service postgresql start
|
8 |
+
|
9 |
+
# Wait for PostgreSQL to start
|
10 |
+
until pg_isready -U postgres; do
|
11 |
+
echo "Waiting for PostgreSQL..."
|
12 |
sleep 2
|
13 |
done
|
14 |
|
15 |
+
# Create user and database
|
16 |
+
sudo -u postgres psql -c "CREATE USER postadmin WITH PASSWORD 'postpass';"
|
17 |
+
sudo -u postgres psql -c "CREATE DATABASE siksalaya;"
|
18 |
+
sudo -u postgres psql -c "GRANT ALL PRIVILEGES ON DATABASE siksalaya TO postadmin;"
|
19 |
+
|
20 |
# Run migrations
|
21 |
alembic upgrade head
|
22 |
|
23 |
# Start the FastAPI app using Uvicorn
|
24 |
+
uvicorn app:app --host 0.0.0.0 --port 7860
|