FROM python:3.10-slim-bookworm

# System dependencies:
# - libusb-1.0-0: depthai talks to the OAK-1 over USB via libusb
# - libgl1: some depthai/opencv wheels link against it even in headless mode
# - pulseaudio-utils / alsa-utils: audio alert playback (paplay / aplay fallback)
RUN apt-get update && apt-get install -y --no-install-recommends \
    libusb-1.0-0 \
    libgl1 \
    pulseaudio-utils \
    alsa-utils \
    && rm -rf /var/lib/apt/lists/*

WORKDIR /app

COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt

COPY app.py .
COPY static/ static/
COPY *.wav ./
COPY models/ models/

EXPOSE 8000

CMD ["python", "app.py"]
