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=1                               # 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 "/"
    restart: unless-stopped
    working_dir: /app
    ports:
      - 80:18080
      - 6901:6901 # vnc port to access burpsuite
      - 8081:8080 # burpsuite port of http proxy

  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
  
  restarter:              # restarts the flaresolverr so its always ready for work
    image: docker:cli
    container_name: flaresolverr-restarter
    volumes: ["/var/run/docker.sock:/var/run/docker.sock"]
    command: ["/bin/sh", "-c", "while true; do sleep 26400; docker restart flaresolverr; done"]
    restart: unless-stopped
