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:
2026-04-26 13:33:23 +03:00
parent 8117216a3b
commit 5d21e72efd

View File

@@ -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["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 = [
sys.executable, "-m", "uvicorn",
python_exe, "-m", "uvicorn",
"backend.main:app",
"--host", "0.0.0.0",
"--port", str(backend_port)