diff --git a/__pycache__/app.cpython-312.pyc b/__pycache__/app.cpython-312.pyc index 11639c2..872e05b 100644 Binary files a/__pycache__/app.cpython-312.pyc and b/__pycache__/app.cpython-312.pyc differ diff --git a/app.py b/app.py index 54c7cb3..8960865 100644 --- a/app.py +++ b/app.py @@ -78,14 +78,31 @@ async def run_browser_task(task_id: str, task: str, max_steps: int, model: str): # Если включен remote debugging - запускаем Chrome вручную и подключаемся через CDP if REMOTE_DEBUGGING_ENABLED: import subprocess - import tempfile + import os + + # Ищем chromium в типичных местах + chromium_paths = [ + "/ms-playwright/chromium/chrome-linux/chrome", + "/usr/bin/chromium", + "/usr/bin/chromium-browser", + "/usr/bin/google-chrome", + ] + + chrome_exe = None + for path in chromium_paths: + if os.path.exists(path): + chrome_exe = path + break + + if not chrome_exe: + raise RuntimeError("Chrome/Chromium not found in container") # Создаем временную директорию для профиля user_data_dir = "/app/browser-data" # Запускаем Chrome с remote debugging chrome_cmd = [ - "chromium", + chrome_exe, f"--remote-debugging-port={REMOTE_DEBUGGING_PORT}", f"--user-data-dir={user_data_dir}", "--no-first-run", @@ -94,6 +111,7 @@ async def run_browser_task(task_id: str, task: str, max_steps: int, model: str): "--disable-popup-blocking", "--disable-gpu", "--no-sandbox", + "--disable-dev-shm-usage", "about:blank" ]