-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun_direct.sh
More file actions
executable file
·44 lines (37 loc) · 1.01 KB
/
Copy pathrun_direct.sh
File metadata and controls
executable file
·44 lines (37 loc) · 1.01 KB
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
40
41
42
43
44
#!/usr/bin/env bash
# Simple direct run script for AI Avatar Video application
set -e
# Use explicit port
PORT=${1:-8084}
echo "Using port: ${PORT}"
# Kill any process using the specified port
echo "Checking for processes using port $PORT..."
PID=$(lsof -t -i:$PORT 2>/dev/null)
if [ -n "$PID" ]; then
echo "Found process $PID using port $PORT. Killing..."
kill -9 $PID || true
sleep 1
else
echo "No process found using port $PORT."
fi
# Activate virtual environment
if [ -d "venv" ]; then
source venv/bin/activate
elif [ -d ".venv" ]; then
source .venv/bin/activate
else
echo "Virtual environment not found. Please create it first."
exit 1
fi
# Initialize database
echo "Initializing database..."
python3 -c "
from app.database import Base, engine
import app.models
# Create tables
Base.metadata.create_all(bind=engine)
print('Database tables created successfully!')
"
# Start the server
echo "Starting server in development mode..."
exec python3 -m uvicorn app.main:app --host 0.0.0.0 --port ${PORT}