1- # Docker Setup for Chrome DevTools Frontend
1+ # Docker Setup for Browser Operator DevTools + Agent Server
22
3- This directory contains Docker configuration files for building and running the Chrome DevTools Frontend in a containerized environment.
3+ This directory contains Docker configuration files for building and running the Browser Operator DevTools Frontend with integrated Agent Server in a containerized environment.
44
55## Overview
66
77The Docker setup uses a multi-stage build process:
8- 1 . ** Build Stage** : Compiles the DevTools frontend using the full development environment
9- 2 . ** Production Stage** : Serves only the built files using Nginx (lightweight, ~ 50MB final image)
8+ 1 . ** DevTools Build Stage** : Compiles the DevTools frontend using the full development environment
9+ 2 . ** Agent Server Build Stage** : Installs Node.js dependencies for the agent server
10+ 3 . ** Production Stage** : Serves DevTools via Nginx + runs Agent Server (Node.js) in the same container
1011
1112## Prerequisites
1213
@@ -22,11 +23,8 @@ The Docker setup uses a multi-stage build process:
2223From the repository root directory:
2324
2425``` bash
25- # Build with automated mode (default - bypasses OAuth, auto-enables evaluation)
26- docker build -f docker/Dockerfile -t browser-operator-automated .
27-
28- # Build with normal mode (requires manual authentication)
29- docker build -f docker/Dockerfile --build-arg AUTOMATED_MODE=false -t browser-operator-manual .
26+ # Build DevTools image (AUTOMATED_MODE is always enabled)
27+ docker build -f docker/Dockerfile -t browser-operator-devtools .
3028
3129# Or use docker-compose (recommended)
3230docker-compose -f docker/docker-compose.yml build
@@ -35,67 +33,143 @@ docker-compose -f docker/docker-compose.yml build
3533### Running the Container
3634
3735``` bash
38- # Automated mode (no authentication required, evaluation auto-enabled)
39- docker run -d -p 8000:8000 --name browser-operator-automated browser-operator-automated
40-
41- # Manual mode (requires OAuth/API key setup)
42- docker run -d -p 8000:8000 --name browser-operator-manual browser-operator-manual
36+ # Run DevTools container (AUTOMATED_MODE enabled by default)
37+ docker run -d -p 8000:8000 --name browser-operator-devtools browser-operator-devtools
4338
4439# Or using docker-compose (recommended)
4540docker-compose -f docker/docker-compose.yml up -d
4641```
4742
48- The DevTools will be available at: http://localhost:8000
43+ The services will be available at:
44+ - ** DevTools UI** : http://localhost:8000
45+ - ** Agent Server HTTP API** : http://localhost:8080
46+ - ** Agent Server WebSocket** : ws://localhost:8082
4947
5048### Accessing DevTools
5149
52- Once the container is running, open Chrome or Chromium with:
50+ Once the container is running, open Chrome or Chromium with remote debugging enabled :
5351
5452``` bash
5553# macOS
56- /Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --custom-devtools-frontend=http://localhost:8000/
54+ " /Applications/Google Chrome.app/Contents/MacOS/Google Chrome" \
55+ --remote-debugging-port=9222 \
56+ --remote-allow-origins=" *" \
57+ --auto-open-devtools-for-tabs \
58+ --user-data-dir=/tmp/chrome-debug-profile \
59+ --custom-devtools-frontend=http://localhost:8000/
5760
5861# Linux
59- google-chrome --custom-devtools-frontend=http://localhost:8000/
62+ google-chrome \
63+ --remote-debugging-port=9222 \
64+ --remote-allow-origins=" *" \
65+ --auto-open-devtools-for-tabs \
66+ --user-data-dir=/tmp/chrome-debug-profile \
67+ --custom-devtools-frontend=http://localhost:8000/
6068
6169# Windows
62- chrome.exe --custom-devtools-frontend=http://localhost:8000/
70+ " C:\Program Files\Google\Chrome\Application\chrome.exe" \
71+ --remote-debugging-port=9222 \
72+ --remote-allow-origins=" *" \
73+ --auto-open-devtools-for-tabs \
74+ --user-data-dir=C:\t emp\c hrome-debug-profile \
75+ --custom-devtools-frontend=http://localhost:8000/
6376```
6477
78+ ** Important flags:**
79+ - ` --remote-debugging-port=9222 ` - Enables CDP for the Agent Server to connect
80+ - ` --remote-allow-origins="*" ` - Allows CDP connections from Docker containers
81+ - ` --auto-open-devtools-for-tabs ` - Automatically opens DevTools for new tabs (required for agent-server automation)
82+ - ` --user-data-dir=/tmp/chrome-debug-profile ` - Uses a temporary profile to avoid conflicts
83+ - ` --custom-devtools-frontend=http://localhost:8000/ ` - Uses the Browser Operator DevTools
84+
85+ ** Note:** Make sure to completely quit Chrome before starting it with these flags. On macOS, use ` Cmd+Q ` or run ` killall "Google Chrome" ` .
86+
6587## File Structure
6688
6789```
6890docker/
69- ├── Dockerfile # Multi-stage build configuration
91+ ├── Dockerfile # Multi-stage build (DevTools + Agent Server)
7092├── .dockerignore # Files to exclude from Docker context
7193├── nginx.conf # Nginx server configuration
7294├── docker-compose.yml # Docker Compose configuration
7395└── README.md # This file
96+
97+ ../agent-server/ # Agent Server source code (included in build)
7498```
7599
76- ## Automated Mode vs Manual Mode
100+ ## Automated Mode (Always Enabled)
77101
78- ### Automated Mode (Default)
79- - ** Purpose** : Optimized for Docker/CI environments and automated workflows
80- - ** Authentication** : Bypasses OAuth panel - no manual setup required
81- - ** Evaluation** : Automatically enables evaluation mode for API wrapper connectivity
82- - ** Use cases** : Production deployments, CI/CD, headless automation, API integration
102+ This Docker image is built with ** AUTOMATED_MODE** always enabled for seamless deployment:
83103
84- ### Manual Mode
85- - ** Purpose** : Standard interactive usage
86- - ** Authentication** : Requires OAuth setup or API key configuration
87- - ** Evaluation** : Manual enable/disable in settings
88- - ** Use cases** : Development, interactive testing, manual usage
104+ - ** Authentication** : Bypasses OAuth panel - no manual setup required
105+ - ** Evaluation** : Automatically enables evaluation mode for agent-server connectivity
106+ - ** Use cases** : Production deployments, CI/CD, headless automation, API integration
89107
90108``` bash
91- # Example automated mode workflow
92- docker build -f docker/Dockerfile -t browser-operator-automated .
93- docker run -d -p 8000:8000 --name browser-operator browser-operator-automated
109+ # Example workflow - ready to use immediately
110+ docker build -f docker/Dockerfile -t browser-operator-devtools .
111+ docker run -d -p 8000:8000 --name browser-operator browser-operator-devtools
94112
95113# Ready to use immediately - no authentication required!
96- # Evaluation server can connect automatically via WebSocket (ws://localhost:8080 )
114+ # Agent server can connect automatically via WebSocket (ws://localhost:8082 )
97115```
98116
117+ ** Note** : This approach matches the parent repository's ` Dockerfile.devtools ` which has proven to work "rock-solid" in production.
118+
119+ ## Agent Server
120+
121+ The container includes a fully functional Agent Server that provides:
122+
123+ ### WebSocket API (port 8082)
124+ - JSON-RPC 2.0 bidirectional communication
125+ - Browser agent lifecycle management
126+ - Direct CDP integration
127+
128+ ### HTTP REST API (port 8080)
129+ - ` POST /v1/responses ` - Send tasks to browser agents
130+ - ` POST /page/screenshot ` - Capture screenshots via CDP
131+ - ` POST /page/content ` - Get HTML/text content
132+ - ` GET /status ` - Health check
133+
134+ ### Configuration
135+
136+ The Agent Server runs with these default settings:
137+ - ** WebSocket Port** : 8082
138+ - ** HTTP API Port** : 8080
139+ - ** Host** : 0.0.0.0 (listens on all interfaces)
140+ - ** Authentication** : Disabled (automated mode)
141+
142+ To customize, you can override environment variables:
143+
144+ ``` bash
145+ docker run -d -p 8000:8000 -p 8080:8080 -p 8082:8082 \
146+ -e EVAL_SERVER_WS_PORT=8082 \
147+ -e EVAL_SERVER_HTTP_PORT=8080 \
148+ -e EVAL_SERVER_HOST=0.0.0.0 \
149+ browser-operator-devtools
150+ ```
151+
152+ ### Testing the Agent Server
153+
154+ ``` bash
155+ # Health check
156+ curl http://localhost:8080/status
157+
158+ # Send a task (requires browser with remote debugging)
159+ curl -X POST http://localhost:8080/v1/responses \
160+ -H " Content-Type: application/json" \
161+ -d ' {
162+ "input": "Navigate to google.com",
163+ "url": "about:blank",
164+ "wait_timeout": 5000,
165+ "model": {
166+ "main_model": {"provider": "openai", "model": "gpt-4", "api_key": "sk-..."}
167+ }
168+ }'
169+ ```
170+
171+ For more details on the Agent Server API, see ` ../agent-server/README.md ` .
172+
99173## Advanced Usage
100174
101175### Development Mode
0 commit comments