# Dockerfile pour Web Sentinel
FROM python:3.11-slim

# Métadonnées
LABEL maintainer="web-sentinel@example.com"
LABEL version="1.0"
LABEL description="Web Sentinel Security Scanner - Containerized CLI"

# Variables d'environnement
ENV PYTHONPATH=/app
ENV PYTHONUNBUFFERED=1
ENV WEB_SENTINEL_DOCKER=1

# Dépendances système
RUN apt-get update && apt-get install -y \
    && rm -rf /var/lib/apt/lists/*

# Répertoire de travail
WORKDIR /app

# Copier les requirements d'abord (pour le cache Docker)
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt

# Copier le code source
COPY web_sentinel/ ./web_sentinel/
COPY *.py ./

# Créer un utilisateur non-root pour la sécurité
RUN useradd --create-home --shell /bin/bash sentinel
USER sentinel

# Volumes pour la persistance
VOLUME ["/data"]

# Point d'entrée
ENTRYPOINT ["python", "-m", "web_sentinel.cli"]

# Commande par défaut (aide)
CMD ["--help"]