init. project
This commit is contained in:
25
rag-web-ui/backend/entrypoint.sh
Normal file
25
rag-web-ui/backend/entrypoint.sh
Normal file
@@ -0,0 +1,25 @@
|
||||
#!/bin/sh
|
||||
|
||||
# exit on error
|
||||
set -e
|
||||
|
||||
echo "Waiting for MySQL..."
|
||||
while ! nc -z db 3306; do
|
||||
sleep 1
|
||||
done
|
||||
echo "MySQL started"
|
||||
|
||||
echo "Running migrations..."
|
||||
if alembic upgrade head; then
|
||||
echo "Migrations completed successfully"
|
||||
else
|
||||
echo "Migration failed"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "Starting application..."
|
||||
if [ "$ENVIRONMENT" = "development" ]; then
|
||||
uvicorn app.main:app --host 0.0.0.0 --port 8000 --reload
|
||||
else
|
||||
uvicorn app.main:app --host 0.0.0.0 --port 8000
|
||||
fi
|
||||
Reference in New Issue
Block a user