FROM python:3.11-slim # Install system dependencies and masscan RUN apt-get update && \ apt-get install -y --no-install-recommends \ git \ build-essential \ libpcap-dev \ nmap \ chromium \ chromium-driver \ && rm -rf /var/lib/apt/lists/* # Build and install masscan from source RUN git clone https://github.com/robertdavidgraham/masscan /tmp/masscan && \ cd /tmp/masscan && \ make && \ make install && \ cd / && \ rm -rf /tmp/masscan # Set working directory WORKDIR /app # Copy requirements and install Python dependencies COPY requirements.txt . RUN pip install --no-cache-dir -r requirements.txt # Install Playwright browsers (Chromium only) # Note: We skip --with-deps since we already installed system chromium and dependencies above RUN playwright install chromium # Copy application code COPY src/ ./src/ # Create output directory RUN mkdir -p /app/output # Make scanner executable RUN chmod +x /app/src/scanner.py # Force Python unbuffered output ENV PYTHONUNBUFFERED=1 # Set entry point with unbuffered Python ENTRYPOINT ["python3", "-u", "/app/src/scanner.py"] CMD ["--help"]