-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstart.sh
More file actions
executable file
·39 lines (31 loc) · 944 Bytes
/
start.sh
File metadata and controls
executable file
·39 lines (31 loc) · 944 Bytes
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
# Start AI Code Executor
cd "$(dirname "$0")"
# Activate virtual environment
if [ -f "venv/bin/activate" ]; then
source venv/bin/activate
elif [ -f "venv/Scripts/activate" ]; then
source venv/Scripts/activate
else
echo "❌ Virtual environment not found! Run ./INSTALL.sh first."
exit 1
fi
# Load environment
[ -f ".env" ] && export $(grep -v '^#' .env | xargs 2>/dev/null)
HOST=${HOST:-0.0.0.0}
PORT=${PORT:-8000}
# Set PYTHONPATH
export PYTHONPATH="${PYTHONPATH}:$(pwd)"
# Fix for macOS multiprocessing with --reload
# See: https://github.com/encode/uvicorn/issues/1045
export OBJC_DISABLE_INITIALIZE_FORK_SAFETY=YES
echo ""
echo "🚀 Starting AI Code Executor..."
echo ""
echo " URL: http://localhost:$PORT"
echo ""
echo " Press Ctrl+C to stop"
echo ""
# Start server
# Use --reload for development (auto-restart on code changes)
python -m uvicorn backend.main:app --host $HOST --port $PORT --reload