# ─────────────────────────────────────────────
# ffuf-automation — Dockerfile
# Base: Kali Linux (has ffuf + security tools)
# ─────────────────────────────────────────────
FROM kalilinux/kali-rolling:latest

LABEL maintainer=""
LABEL description="ffuf-automation: authorized web directory discovery tool"

# Avoid interactive prompts during apt
ENV DEBIAN_FRONTEND=noninteractive

# ── System packages ──────────────────────────
RUN apt-get update && apt-get install -y --no-install-recommends \
    ffuf \
    python3 \
    python3-pip \
    python3-jinja2 \
    seclists \
    curl \
    wget \
    ca-certificates \
 && apt-get clean \
 && rm -rf /var/lib/apt/lists/*

# ── Working directory ────────────────────────
WORKDIR /app

# ── Copy tool files ──────────────────────────
COPY ffuf_automation.py .
COPY requirements.txt .
COPY domains.txt .

# ── Python deps (jinja2 already installed via apt above, this is a safety net) ──
RUN pip3 install --break-system-packages -r requirements.txt 2>/dev/null || true

# ── Create output dirs ───────────────────────
RUN mkdir -p /app/results/raw /app/results/reports /app/results/logs

# ── Wordlists symlink for convenience ────────
# SecLists installs to /usr/share/seclists on Kali
RUN ln -sf /usr/share/seclists /app/wordlists 2>/dev/null || true

# ── Default entrypoint ───────────────────────
ENTRYPOINT ["python3", "ffuf_automation.py"]

# ── Default args (override at runtime) ──────
CMD ["--help"]
