- Transfer user's browser fingerprint (user-agent, viewport, timezone, language, geolocation) to Chrome for more authentic scraping - Display review topics from Google Maps in analytics dashboard - Show business category badge in analytics header - Fix date_text null handling in analytics (handle undefined/timestamp fields) - Add review_topics and business_category to JobStatus interface Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
65 lines
1.6 KiB
YAML
65 lines
1.6 KiB
YAML
version: '3.8'
|
|
|
|
services:
|
|
# PostgreSQL Database
|
|
db:
|
|
image: postgres:15-alpine
|
|
container_name: scraper-db
|
|
environment:
|
|
POSTGRES_DB: scraper
|
|
POSTGRES_USER: scraper
|
|
POSTGRES_PASSWORD: ${DB_PASSWORD:-scraper123}
|
|
ports:
|
|
- "5435:5432"
|
|
volumes:
|
|
- postgres_data:/var/lib/postgresql/data
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "pg_isready -U scraper"]
|
|
interval: 10s
|
|
timeout: 5s
|
|
retries: 5
|
|
networks:
|
|
- scraper-network
|
|
|
|
# API Server
|
|
api:
|
|
build:
|
|
context: .
|
|
dockerfile: Dockerfile
|
|
container_name: scraper-api
|
|
environment:
|
|
- DATABASE_URL=postgresql://scraper:${DB_PASSWORD:-scraper123}@db:5432/scraper
|
|
- API_BASE_URL=${API_BASE_URL:-http://localhost:8000}
|
|
- PORT=8000
|
|
- MAX_CONCURRENT_JOBS=${MAX_CONCURRENT_JOBS:-5}
|
|
- CANARY_TEST_URL=${CANARY_TEST_URL:-https://www.google.com/maps/place/Soho+Factory/@54.6738155,25.2595844,17z/}
|
|
- SLACK_WEBHOOK_URL=${SLACK_WEBHOOK_URL:-}
|
|
# Chromium/Xvfb configuration
|
|
- DISPLAY=:99
|
|
- CHROME_BIN=/usr/bin/chromium
|
|
ports:
|
|
- "8000:8000"
|
|
- "5900:5900" # VNC port (for VNC client)
|
|
- "6080:6080" # noVNC web interface (browser access)
|
|
depends_on:
|
|
db:
|
|
condition: service_healthy
|
|
# Chrome requires shared memory for stability
|
|
shm_size: 2gb
|
|
# Chrome capabilities (needed for sandboxing)
|
|
cap_add:
|
|
- SYS_ADMIN
|
|
# Security options for Chrome
|
|
security_opt:
|
|
- seccomp:unconfined
|
|
networks:
|
|
- scraper-network
|
|
restart: unless-stopped
|
|
|
|
volumes:
|
|
postgres_data:
|
|
|
|
networks:
|
|
scraper-network:
|
|
driver: bridge
|