FROM python:3.12-slim

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

WORKDIR /app

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

COPY main.py /app/

ENV ARCHIVE_DB=/data/archive.db
ENV PORT=8765
EXPOSE 8765

CMD ["python", "-u", "main.py"]
