services:
  hottub:
    build:
      context: .
      dockerfile: Dockerfile
    container_name: hottub
    entrypoint: supervisord
    command: ["-c", "/app/supervisord/supervisord.conf"]
    # In case you dont want the burpsuite proxy and only wanna run the server in the docker without compiling outside:
    # entrypoint: cargo
    # command: ["run"]
    volumes:
      - /path/to/hottub:/app                  # REPLACE
    environment:
      - RUST_LOG=info
      - BURP_URL=http://127.0.0.1:8081        # local burpsuite proxy for crawler analysis
      - PROXY=0                               # 1 for enable, else disabled
      - DATABASE_URL=hottub.db                # sqlite db to store hard to get videos for easy access
      - FLARE_URL=http://flaresolverr:8191/v1 # flaresolverr to get around cloudflare 403 codes
      - DOMAIN=hottub.spacemoehre.de          # optional for the 302 forward on "/" to 
    restart: unless-stopped
    working_dir: /app
    ports:
      - 80:18080
      - 6901:6901 # vnc port to access burpsuite
      - 8081:8080 # burpsuite port of http(s) proxy
    logging:
      driver: "json-file"
      options:
        max-size: "10m"   # Maximum size of each log file (e.g., 10MB)
        max-file: "3"     # Maximum number of log files to keep
    healthcheck:
      test: ["CMD-SHELL", "curl -s -o /dev/null -w '%{http_code}' http://127.0.0.1:18080/api/status | grep -q 200"]
      interval: 30s
      timeout: 5s
      retries: 3
      start_period: 1s
    ulimits:
      nofile:
        soft: 65536
        hard: 65536

# flaresolverr to bypass cloudflare protections
  flaresolverr:
    container_name: flaresolverr
    ports:
      - 8191:8191
    restart: unless-stopped
    image: alexfozor/flaresolverr:pr-1300-experimental      # master branches dont work as good as this one
    environment:
      - LOG_LEVEL=debug
    logging:
      driver: "json-file"
      options:
        max-size: "10m"   # Maximum size of each log file (e.g., 10MB)
        max-file: "3"     # Maximum number of log files to keep
  
 
