-
Notifications
You must be signed in to change notification settings - Fork 0
/
startup.sh
39 lines (29 loc) · 855 Bytes
/
startup.sh
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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#!/bin/bash
# This script starts the AI Backend Wrapper MVP.
set -e
echo "Starting AI Backend Wrapper MVP..."
# Source the environment variables.
if [ -f .env ]; then
source .env
fi
# Start the backend application.
echo "Starting backend..."
uvicorn api.main:app --host 0.0.0.0 --port 8000 --reload &
# Wait for the backend to start.
sleep 5
# Check if the backend is running.
if ! ps aux | grep -q 'uvicorn api.main:app'; then
echo "Error: Backend failed to start."
exit 1
fi
echo "Backend started successfully."
# Optional: Start the database (if applicable).
# echo "Starting database..."
# docker-compose up -d database &
# sleep 5
# if ! docker-compose ps | grep -q 'database'; then
# echo "Error: Database failed to start."
# exit 1
# fi
# echo "Database started successfully."
echo "AI Backend Wrapper MVP started successfully."