1
This commit is contained in:
1 parent
cdba9a29f3
commit
c1c0dfca9e
2 files changed
+15
-6
No files matched your search
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
FROM mcr.microsoft.com/playwright/python:v1.45.0-jammy
|
FROM mcr.microsoft.com/playwright/python:v1.49.0-noble
|
||||||
|
|
||||||
# Установка дополнительных Python зависимостей
|
# Установка дополнительных Python зависимостей
|
||||||
RUN pip install --no-cache-dir \
|
RUN pip install --no-cache-dir \
|
||||||
|
|||||||
@@ -36,6 +36,15 @@ class TaskResponse(BaseModel):
|
|||||||
# Хранилище задач
|
# Хранилище задач
|
||||||
tasks = {}
|
tasks = {}
|
||||||
|
|
||||||
|
@app.on_event("startup")
|
||||||
|
async def startup_event():
|
||||||
|
import sys
|
||||||
|
import pkg_resources
|
||||||
|
print(f"Python version: {sys.version}")
|
||||||
|
print("Installed packages:")
|
||||||
|
for dist in pkg_resources.working_set:
|
||||||
|
print(f" {dist.project_name}=={dist.version}")
|
||||||
|
|
||||||
@app.post("/api/tasks", response_model=TaskResponse)
|
@app.post("/api/tasks", response_model=TaskResponse)
|
||||||
async def create_task(request: TaskRequest):
|
async def create_task(request: TaskRequest):
|
||||||
"""Создать новую задачу браузера"""
|
"""Создать новую задачу браузера"""
|
||||||
@@ -133,16 +142,16 @@ async def run_browser_task(task_id: str, task: str, max_steps: int, model: str):
|
|||||||
chrome_cmd = [
|
chrome_cmd = [
|
||||||
chrome_exe,
|
chrome_exe,
|
||||||
f"--remote-debugging-port={REMOTE_DEBUGGING_PORT}",
|
f"--remote-debugging-port={REMOTE_DEBUGGING_PORT}",
|
||||||
f"--remote-debugging-address=0.0.0.0",
|
"--remote-debugging-address=0.0.0.0",
|
||||||
f"--user-data-dir={user_data_dir}",
|
f"--user-data-dir={user_data_dir}",
|
||||||
"--remote-allow-origins=*",
|
"--remote-allow-origins=*",
|
||||||
|
"--headless=new",
|
||||||
|
"--no-sandbox",
|
||||||
|
"--disable-dev-shm-usage",
|
||||||
|
"--disable-gpu",
|
||||||
"--no-first-run",
|
"--no-first-run",
|
||||||
"--no-default-browser-check",
|
"--no-default-browser-check",
|
||||||
"--disable-extensions",
|
"--disable-extensions",
|
||||||
"--disable-gpu",
|
|
||||||
"--no-sandbox",
|
|
||||||
"--disable-dev-shm-usage",
|
|
||||||
"--headless",
|
|
||||||
"about:blank"
|
"about:blank"
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user