Use remote Chromium container instead of local Puppeteer launch
- Add browserless/chromium container to docker-compose - Add docker-compose.dev.yml for local dev (Chromium on port 3001) - Browser scraper connects via WebSocket (CHROMIUM_WS env var) - Falls back to local launch if CHROMIUM_WS not set - Remove Chromium install from Dockerfile (smaller image) - Auto-reconnect on browser disconnect Tested: remote Chromium connects in ~500ms, HG Spot scrapes in ~2.2s total. No longer blocks the Node.js event loop. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -10,5 +10,15 @@ services:
|
||||
- NODE_ENV=production
|
||||
- DATABASE_PATH=/app/data/pricehunter.db
|
||||
- STORES_DIR=/app/stores
|
||||
- CHROMIUM_WS=ws://chromium:3000
|
||||
- PORT=3000
|
||||
depends_on:
|
||||
- chromium
|
||||
restart: unless-stopped
|
||||
|
||||
chromium:
|
||||
image: ghcr.io/browserless/chromium
|
||||
environment:
|
||||
- MAX_CONCURRENT_SESSIONS=5
|
||||
- CONNECTION_TIMEOUT=30000
|
||||
restart: unless-stopped
|
||||
|
||||
Reference in New Issue
Block a user