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 - SEARXNG_URL=http://searxng:8080 - LOG_LEVEL=INFO - CORS_ORIGINS=* depends_on: db: condition: service_healthy browserless: condition: service_started searxng: 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 # SearXNG - Moteur de recherche auto-hébergé searxng: image: searxng/searxng:latest container_name: priceflow-searxng restart: unless-stopped ports: - "8888:8080" environment: - SEARXNG_BASE_URL=http://searxng:8080 - SEARXNG_SECRET=priceflow-searxng-secret volumes: - ./searxng/settings.yml:/etc/searxng/settings.yml:ro command: - sh - -c - | rm -rf /etc/searxng/limiter.toml printf '[botdetection.ip_limit]\nlink_token = false\n\n[botdetection.ip_lists]\npass_ip = ["0.0.0.0/0", "127.0.0.0/8", "172.16.0.0/12", "192.168.0.0/16", "10.0.0.0/8", "::/0"]\nblock_ip = []\n' > /etc/searxng/limiter.toml exec /usr/local/searxng/dockerfiles/docker-entrypoint.sh networks: - nginx_default # Browserless - Navigateur headless pour le scraping browserless: image: ghcr.io/browserless/chromium:latest container_name: priceflow-browserless restart: unless-stopped ports: - "3012:3000" environment: # Timeouts - TIMEOUT=300000 - CONNECTION_TIMEOUT=300000 # Sessions - CONCURRENT=3 - QUEUED=5 # Options de stabilité - HEALTH=true - EXIT_ON_HEALTH_FAILURE=true # Options Chrome - DEFAULT_HEADLESS=true - DEFAULT_STEALTH=true - DEFAULT_BLOCK_ADS=true - DEFAULT_IGNORE_HTTPS_ERRORS=true - CHROME_REFRESH_TIME=3600000 deploy: resources: limits: memory: 3G reservations: memory: 1G shm_size: '2gb' networks: - nginx_default volumes: postgres_data: driver: local screenshots_data: driver: local networks: nginx_default: external: true