| FROM python:3.11-slim | |
| # Install dependencies | |
| RUN apt-get update && apt-get install -y \ | |
| masscan \ | |
| sudo \ | |
| && rm -rf /var/lib/apt/lists/* | |
| # Allow masscan to run without password | |
| RUN echo "www-data ALL=(ALL) NOPASSWD: /usr/bin/masscan" >> /etc/sudoers | |
| WORKDIR /app | |
| COPY requirements.txt . | |
| RUN pip install --no-cache-dir -r requirements.txt | |
| COPY . . | |
| # Run as www-data (Flask default user) | |
| USER www-data | |
| EXPOSE 5000 | |
| CMD ["gunicorn", "--bind", "0.0.0.0:5000", "--workers", "1", "app:app"] | |