Files
flynn/deploy/whisper/Dockerfile
T
William Valentin 636f4b3311 feat(deploy): add whisper.cpp Kubernetes deployment
Add Dockerfile and K8s manifests for whisper.cpp transcription service.
Deploys to ai-stack namespace with worker node affinity for GPU access.
2026-02-12 00:14:41 -08:00

41 lines
1.2 KiB
Docker

FROM ubuntu:22.04 AS build
WORKDIR /app
RUN apt-get update && \
apt-get install -y build-essential wget cmake git \
&& rm -rf /var/lib/apt/lists/*
ARG WHISPER_CPP_VERSION=v1.8.3
RUN git clone --depth 1 --branch ${WHISPER_CPP_VERSION} \
https://github.com/ggml-org/whisper.cpp.git .
ARG WHISPER_MODEL=base.en
RUN bash ./models/download-ggml-model.sh ${WHISPER_MODEL}
RUN cmake -B build && cmake --build build --config Release -j$(nproc)
FROM ubuntu:22.04
WORKDIR /app
RUN apt-get update && \
apt-get install -y curl ffmpeg \
&& rm -rf /var/lib/apt/lists/*
COPY --from=build /app/build/bin/whisper-server /usr/local/bin/whisper-server
COPY --from=build /app/build/src/libwhisper.so* /usr/local/lib/
COPY --from=build /app/build/ggml/src/libggml*.so* /usr/local/lib/
COPY --from=build /app/models /app/models
RUN ldconfig
ARG WHISPER_MODEL=base.en
ENV WHISPER_MODEL_PATH=/app/models/ggml-${WHISPER_MODEL}.bin
EXPOSE 8080
ENTRYPOINT ["whisper-server"]
CMD ["--model", "/app/models/ggml-base.en.bin", \
"--host", "0.0.0.0", \
"--port", "8080", \
"--convert", \
"--language", "en", \
"--inference-path", "/v1/audio/transcriptions"]