FROM python:3.11-slim

RUN apt-get update && apt-get install -y --no-install-recommends \
    libpcap-dev \
    tcpdump \
    && rm -rf /var/lib/apt/lists/*

WORKDIR /app

RUN pip install --no-cache-dir scapy joblib numpy pytest \
    --index-url https://download.pytorch.org/whl/cpu torch \
    --extra-index-url https://pypi.org/simple

COPY sniffer.py flow_aggregator.py inference_engine.py db_writer.py ./
COPY tests/ ./tests/
COPY models/ ./models/

CMD ["python3", "-u", "flow_aggregator.py"]
