version: '3.8'

services:
  krawl:
    build:
      context: .
      dockerfile: Dockerfile
    container_name: krawl-server
    ports:
      - "5000:5000"
    volumes:
      - ./wordlists.json:/app/wordlists.json:ro
    environment:
      - PORT=5000
      - DELAY=100
      - LINKS_MIN_LENGTH=5
      - LINKS_MAX_LENGTH=15
      - LINKS_MIN_PER_PAGE=10
      - LINKS_MAX_PER_PAGE=15
      - MAX_COUNTER=10
      - CANARY_TOKEN_TRIES=10
      - PROBABILITY_ERROR_CODES=0
      - SERVER_HEADER=Apache/2.2.22 (Ubuntu)
      # Optional: Set your canary token URL
      # - CANARY_TOKEN_URL=http://canarytokens.com/api/users/YOUR_TOKEN/passwords.txt
      # Optional: Set custom dashboard path (auto-generated if not set)
      # - DASHBOARD_SECRET_PATH=/my-secret-dashboard
    restart: unless-stopped
    healthcheck:
      test: ["CMD", "python3", "-c", "import requests; requests.get('http://localhost:5000')"]
      interval: 30s
      timeout: 5s
      retries: 3
      start_period: 10s
