FROM python:3.11-slim AS builder RUN apt-get update && apt-get install -y --no-install-recommends \ build-essential cmake git ffmpeg && \ rm -rf /var/lib/apt/lists/* WORKDIR /build RUN git clone --depth 1 https://github.com/ggml-org/whisper.cpp . RUN cmake -B build -DCMAKE_BUILD_TYPE=Release && \ cmake --build build -j --config Release --target whisper-cli FROM python:3.11-slim RUN apt-get update && apt-get install -y --no-install-recommends \ ffmpeg libsndfile1 && rm -rf /var/lib/apt/lists/* WORKDIR /app COPY --from=builder /build/build/bin/whisper-cli /usr/local/bin/whisper-cli COPY --from=builder /build/build/src/libwhisper.so* /usr/local/lib/ RUN ldconfig COPY requirements.txt . RUN pip install --no-cache-dir -r requirements.txt COPY . . RUN mkdir -p /app/dataset/audio /app/static && chmod -R 777 /app/dataset /app/static EXPOSE 7860 CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]