mirror of
https://github.com/R0m1k3/Priceflow.git
synced 2026-10-12 01:39:25 +02:00
Browserless (docker-compose.yml): - CONNECTION_TIMEOUT augmenté à 180s - MAX_CONCURRENT_SESSIONS réduit à 3 - Limite mémoire 2G ajoutée - Args Chrome optimisés (disable-dev-shm-usage, no-sandbox) Scraper Service: - Ajout simplification automatique des URLs Amazon (extraction ASIN) - Suppression des paramètres de tracking (utm_, ref, etc.) - Système de retries (2 tentatives avec backoff) - Screenshot pris AVANT extraction texte (évite perte si timeout) - Popups Amazon ajoutés (#sp-cc-accept, etc.) - Meilleure gestion des erreurs avec logs détaillés
84 lines
1.9 KiB
YAML
84 lines
1.9 KiB
YAML
version: '3.8'
|
|
|
|
services:
|
|
# Application PriceFlow
|
|
app:
|
|
build:
|
|
context: .
|
|
dockerfile: Dockerfile
|
|
container_name: priceflow-app
|
|
restart: unless-stopped
|
|
ports:
|
|
- "8555:8555"
|
|
environment:
|
|
- DATABASE_URL=postgresql://priceflow:priceflow@db:5432/priceflow
|
|
- BROWSERLESS_URL=ws://browserless:3000
|
|
- LOG_LEVEL=INFO
|
|
- CORS_ORIGINS=*
|
|
depends_on:
|
|
db:
|
|
condition: service_healthy
|
|
browserless:
|
|
condition: service_started
|
|
volumes:
|
|
- screenshots_data:/app/screenshots
|
|
networks:
|
|
- nginx_default
|
|
|
|
# Base de données PostgreSQL
|
|
db:
|
|
image: postgres:15-alpine
|
|
container_name: priceflow-db
|
|
restart: unless-stopped
|
|
ports:
|
|
- "5488:5432"
|
|
environment:
|
|
- POSTGRES_USER=priceflow
|
|
- POSTGRES_PASSWORD=priceflow
|
|
- POSTGRES_DB=priceflow
|
|
volumes:
|
|
- postgres_data:/var/lib/postgresql/data
|
|
- ./init.sql:/docker-entrypoint-initdb.d/init.sql:ro
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "pg_isready -U priceflow -d priceflow"]
|
|
interval: 10s
|
|
timeout: 5s
|
|
retries: 5
|
|
networks:
|
|
- nginx_default
|
|
|
|
# Browserless - Navigateur headless pour le scraping
|
|
browserless:
|
|
image: browserless/chrome:latest
|
|
container_name: priceflow-browserless
|
|
restart: unless-stopped
|
|
ports:
|
|
- "3012:3000"
|
|
environment:
|
|
- MAX_CONCURRENT_SESSIONS=3
|
|
- CONNECTION_TIMEOUT=180000
|
|
- MAX_QUEUE_LENGTH=5
|
|
- PREBOOT_CHROME=true
|
|
- KEEP_ALIVE=true
|
|
- DEFAULT_BLOCK_ADS=true
|
|
- DEFAULT_STEALTH=true
|
|
- ENABLE_DEBUGGER=false
|
|
- DISABLED_FEATURES=gpu
|
|
- DEFAULT_LAUNCH_ARGS=["--disable-dev-shm-usage","--no-sandbox","--disable-setuid-sandbox"]
|
|
deploy:
|
|
resources:
|
|
limits:
|
|
memory: 2G
|
|
networks:
|
|
- nginx_default
|
|
|
|
volumes:
|
|
postgres_data:
|
|
driver: local
|
|
screenshots_data:
|
|
driver: local
|
|
|
|
networks:
|
|
nginx_default:
|
|
external: true
|