Repository navigation
Expand file tree
/
Copy pathdocker-compose.browserless.yml
More file actions
87 lines (76 loc) · 2.6 KB
/
Copy pathdocker-compose.browserless.yml
File metadata and controls
87 lines (76 loc) · 2.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
# Browserless Chrome with Remote Debugging
# Provides a headless Chrome instance with remote debugging enabled
# Usage: docker-compose -f docker-compose.browserless.yml up -d
#
# Remote debugging port: 9222
# Connect via: ws://localhost:9222/devtools/browser/<id>
services:
# ============================================================================
# Browserless - Headless Chrome with Remote Debugging
# ============================================================================
browserless:
image: browserless/chrome:latest
container_name: browserless-chrome
ports:
- "3000:3000" # Browserless HTTP API
- "9222:9222" # Chrome Remote Debugging Protocol
environment:
# Enable remote debugging
- DEBUG=browserless*
- ENABLE_DEBUGGER=true
- CHROME_REFRESH_TIME=0
# Connection settings
- CONNECTION_TIMEOUT=60000
- MAX_CONCURRENT_SESSIONS=10
- QUEUE_LENGTH=10
# Chrome flags for remote debugging
- PREBOOT_CHROME=true
- KEEP_ALIVE=true
- DEFAULT_LAUNCH_ARGS=["--remote-debugging-address=0.0.0.0","--remote-debugging-port=9222","--no-sandbox","--disable-setuid-sandbox","--disable-dev-shm-usage","--disable-gpu"]
# Security (adjust for your needs)
- TOKEN=
- CORS=true
# Resource limits
- MAX_CPU_PERCENT=99
- MAX_MEMORY_PERCENT=99
shm_size: 2gb
networks:
- browserless-net
- tinyrsvp_tinyrsvp-test
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:3000/pressure"]
interval: 30s
timeout: 10s
retries: 3
start_period: 30s
restart: unless-stopped
networks:
browserless-net:
driver: bridge
tinyrsvp_tinyrsvp-test:
external: true
# Usage Examples:
#
# 1. Start TinyRSVP test environment first (creates the network):
# docker-compose -f docker-compose.test.yml up -d
#
# 2. Start browserless (connects to TinyRSVP network):
# docker-compose -f docker-compose.browserless.yml up -d
#
# 3. Access TinyRSVP from browserless container:
# - Via Traefik: http://traefik-test:80 (port 8081 on host)
# - Direct to app: http://tinyrsvp-tinyrsvp:8080
#
# 4. Connect to remote debugging from host:
# - Chrome DevTools: chrome://inspect
# - WebSocket: ws://localhost:9222/devtools/browser/<id>
# - HTTP API: http://localhost:3000
#
# 5. Get browser WebSocket endpoint:
# curl http://localhost:3000/json/version
#
# 6. Stop browserless:
# docker-compose -f docker-compose.browserless.yml down
#
# 7. View logs:
# docker-compose -f docker-compose.browserless.yml logs -f