Spaces:
Build error
Build error
File size: 576 Bytes
5ce62ba 7e56007 e9fa6d9 4378bc0 5ce62ba e9fa6d9 5ce62ba 7e56007 e9fa6d9 |
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 |
#!/bin/bash
# Start Redis
service redis-server start
# Start PostgreSQL
service postgresql start
# Wait for PostgreSQL to start
until pg_isready -U postgres; do
echo "Waiting for PostgreSQL..."
sleep 2
done
# Create user and database
sudo -u postgres psql -c "CREATE USER postadmin WITH PASSWORD 'postpass';"
sudo -u postgres psql -c "CREATE DATABASE siksalaya;"
sudo -u postgres psql -c "GRANT ALL PRIVILEGES ON DATABASE siksalaya TO postadmin;"
# Run migrations
alembic upgrade head
# Start the FastAPI app using Uvicorn
uvicorn app:app --host 0.0.0.0 --port 7860
|