FROM python:3.12-slim

WORKDIR /app

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

COPY app.py .
COPY modules/ ./modules/
COPY scripts/ ./scripts/

EXPOSE 8098

# gunicorn instead of the Flask dev server for production use; single worker
# is enough for this low-traffic single-device use case, threaded to allow
# concurrent tracking + dashcam-upload requests.
CMD ["gunicorn", "--bind", "0.0.0.0:8098", "--workers", "1", "--threads", "4", \
     "--timeout", "300", "app:app"]
