# documentation: https://github.com/dgtlmoon/changedetection.io/
# slogan: Website change detection monitor and notifications.
# category: monitoring
# tags: web, alert, monitor
# logo: svgs/changedetection.png
# port: 5000

services:
  changedetection:
    image: ghcr.io/dgtlmoon/changedetection.io
    volumes:
      - changedetection-data:/datastore
    environment:
      - SERVICE_URL_CHANGEDETECTION_5000
      - BASE_URL=${SERVICE_URL_CHANGEDETECTION}
      - PUID=${PUID:-1000}
      - PGID=${PGID:-1000}
      - PLAYWRIGHT_DRIVER_URL=${PLAYWRIGHT_DRIVER_URL:-ws://browser-sockpuppet-chrome:3000}
      - HIDE_REFERER=${HIDE_REFERER:-true}
      - FETCH_WORKERS=${FETCH_WORKERS:-10}
      - MINIMUM_SECONDS_RECHECK_TIME=${MINIMUM_SECONDS_RECHECK_TIME:-3}
      - DISABLE_VERSION_CHECK=${DISABLE_VERSION_CHECK:-true}
      - SCREENSHOT_MAX_HEIGHT=${SCREENSHOT_MAX_HEIGHT:-16000}
      - TZ=${TZ:-UTC}
      - LOGGER_LEVEL=${LOGGER_LEVEL:-DEBUG}
    healthcheck:
      test: ["CMD", "echo", "ok"]
      interval: 5s
      timeout: 20s
      retries: 10
    depends_on:
      browser-sockpuppet-chrome:
        condition: service_started

  browser-sockpuppet-chrome:
    hostname: browser-sockpuppet-chrome
    image: dgtlmoon/sockpuppetbrowser:latest
    cap_add:
      - SYS_ADMIN
    environment:
      - SCREEN_WIDTH=${SCREEN_WIDTH:-1920}
      - SCREEN_HEIGHT=${SCREEN_HEIGHT:-1024}
      - SCREEN_DEPTH=${SCREEN_DEPTH:-16}
      - MAX_CONCURRENT_CHROME_PROCESSES=${MAX_CONCURRENT_CHROME_PROCESSES:-10}
    healthcheck:
      test: ["CMD", "echo", "ok"]
      interval: 5s
      timeout: 20s
      retries: 10
