File size: 623 Bytes
3f05344
 
 
 
 
65f0789
 
3f05344
 
 
 
 
 
 
 
 
65f0789
3f05344
65f0789
3f05344
 
 
 
 
 
 
 
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
#!/bin/bash
set -e

echo "Starting CUA2 Application..."

# Start nginx in the background using the config from the app directory
nginx -c $HOME/app/nginx.conf -g 'daemon off;' &

sleep 2

# Check if nginx is running
if ! pgrep nginx > /dev/null; then
    echo "Error: nginx failed to start"
    exit 1
fi

echo "nginx started successfully"

cd $HOME/app/cua2-core

# Set default number of workers if not specified
WORKERS=${WORKERS:-1}

echo "Starting backend with $WORKERS worker(s)..."

# Use uv to run the application
exec uv run uvicorn cua2_core.main:app --host 0.0.0.0 --port 8000 --workers $WORKERS --log-level info