edit docker files, add skill of browser-use in the workdir
This commit is contained in:
parent
2f74daa8a6
commit
7832c30cc0
12 changed files with 421 additions and 4 deletions
21
docker/chromium-gui/Dockerfile
Normal file
21
docker/chromium-gui/Dockerfile
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
FROM debian:bookworm-slim
|
||||
|
||||
RUN apt-get update && apt-get install -y --no-install-recommends \
|
||||
chromium \
|
||||
xvfb \
|
||||
x11vnc \
|
||||
fluxbox \
|
||||
novnc \
|
||||
websockify \
|
||||
socat \
|
||||
ca-certificates \
|
||||
curl \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
COPY start.sh /usr/local/bin/start-gui-chromium.sh
|
||||
RUN chmod +x /usr/local/bin/start-gui-chromium.sh
|
||||
|
||||
EXPOSE 6080 5900 9222
|
||||
|
||||
CMD ["/usr/local/bin/start-gui-chromium.sh"]
|
||||
|
||||
26
docker/chromium-gui/README.md
Normal file
26
docker/chromium-gui/README.md
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
# Chromium GUI Service
|
||||
|
||||
This container provides a full Chromium GUI with three interfaces:
|
||||
|
||||
- noVNC web UI: `http://localhost:6080/vnc.html`
|
||||
- VNC: `localhost:5900`
|
||||
- CDP endpoint: `http://localhost:9223/json/version`
|
||||
|
||||
## Run
|
||||
|
||||
```bash
|
||||
docker compose --profile gui up -d chromium-gui
|
||||
```
|
||||
|
||||
## Use with browser-use
|
||||
|
||||
Pass the GUI CDP endpoint as HTTP URL (the runner resolves it to a websocket automatically):
|
||||
|
||||
```bash
|
||||
docker compose exec -T hermes-agent python-browser-use \
|
||||
/root/.hermes/skills/autonomous-ai-agents/browser-use/scripts/run_browser_use.py \
|
||||
--cdp-url http://chromium-gui:9223 \
|
||||
--task "Open example.com and return page title" \
|
||||
--max-steps 5
|
||||
```
|
||||
|
||||
30
docker/chromium-gui/start.sh
Normal file
30
docker/chromium-gui/start.sh
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
export DISPLAY=:99
|
||||
SCREEN_RESOLUTION="${SCREEN_RESOLUTION:-1920x1080x24}"
|
||||
|
||||
# Clean stale X lock/socket from previous crashed runs in the same container.
|
||||
rm -f /tmp/.X99-lock
|
||||
rm -f /tmp/.X11-unix/X99
|
||||
|
||||
Xvfb :99 -screen 0 "$SCREEN_RESOLUTION" -ac +extension RANDR &
|
||||
fluxbox >/tmp/fluxbox.log 2>&1 &
|
||||
|
||||
x11vnc -display :99 -forever -shared -rfbport 5900 -nopw >/tmp/x11vnc.log 2>&1 &
|
||||
websockify --web=/usr/share/novnc/ 6080 localhost:5900 >/tmp/novnc.log 2>&1 &
|
||||
socat TCP-LISTEN:9223,fork,bind=0.0.0.0 TCP:127.0.0.1:9222 >/tmp/socat.log 2>&1 &
|
||||
|
||||
exec chromium \
|
||||
--no-sandbox \
|
||||
--disable-dev-shm-usage \
|
||||
--disable-gpu \
|
||||
--disable-setuid-sandbox \
|
||||
--remote-debugging-address=0.0.0.0 \
|
||||
--remote-debugging-port=9222 \
|
||||
--user-data-dir=/tmp/chromium-profile \
|
||||
--window-size=1920,1080 \
|
||||
--no-first-run \
|
||||
--no-default-browser-check \
|
||||
about:blank >/tmp/chromium.log 2>&1
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue