# Use the official Playwright Python image to ensure all Chromium dependencies are present
FROM mcr.microsoft.com/playwright/python:v1.41.0-jammy

# Set working directory
WORKDIR /app

# Install system dependencies (Nmap)
RUN apt-get update && apt-get install -y nmap && rm -rf /var/lib/apt/lists/*

# Copy python requirements first to leverage Docker layer caching
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt

# Copy the rest of the application
COPY . .

# Ensure helper scripts are executable
RUN chmod +x run.sh manage_ui.sh

# Default command just prints help
CMD ["python", "securityscanner.py", "--help"]
