Fix run_standalone.py to use venv python for uvicorn
- Script was using /usr/bin/python3 which doesn't have uvicorn installed - Now detects and uses venv/bin/python3 if available - Backend now starts correctly with: 'python3 scripts/run_standalone.py start|restart' - All services (Backend, Frontend, SSL Proxy) now start properly
This commit is contained in:
@@ -120,8 +120,14 @@ def start_backend(backend_port: int, backend_cfg: Dict[str, Any], background: bo
|
|||||||
os.makedirs(env["DATA_DIR"], exist_ok=True)
|
os.makedirs(env["DATA_DIR"], exist_ok=True)
|
||||||
os.makedirs(env["LOGS_DIR"], exist_ok=True)
|
os.makedirs(env["LOGS_DIR"], exist_ok=True)
|
||||||
|
|
||||||
|
# Use venv python if available
|
||||||
|
python_exe = sys.executable
|
||||||
|
venv_python = os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "venv", "bin", "python3")
|
||||||
|
if os.path.exists(venv_python):
|
||||||
|
python_exe = venv_python
|
||||||
|
|
||||||
cmd = [
|
cmd = [
|
||||||
sys.executable, "-m", "uvicorn",
|
python_exe, "-m", "uvicorn",
|
||||||
"backend.main:app",
|
"backend.main:app",
|
||||||
"--host", "0.0.0.0",
|
"--host", "0.0.0.0",
|
||||||
"--port", str(backend_port)
|
"--port", str(backend_port)
|
||||||
|
|||||||
Reference in New Issue
Block a user