FROM python:3.14.4-slim AS builder

WORKDIR /app
COPY pyproject.toml requirements.txt ./
COPY src src

RUN pip wheel --no-cache-dir --no-deps --wheel-dir wheels .

FROM python:3.14.4-slim AS runner

COPY --from=builder /app/wheels /wheels
RUN pip install --no-cache /wheels/* && rm -rf /wheels
RUN apt update
RUN apt -y install ffmpeg

WORKDIR /app

EXPOSE 8000
CMD ["uvicorn", "audio_server:app", "--host", "0.0.0.0", "--port", "8000"]