Files
meetrec/server/whisper-server/Dockerfile
T
fegger ef59fc0fb4 Add dockerized whisper.cpp inference server (Vulkan GPU, Tailscale)
- server/whisper-server: compose stack built from the pinned whisper.cpp
  v1.9.3 release, same as the Android JNI layer
- Vulkan GPU backend (AMD Radeon AI PRO R9700 / RADV) with transparent
  CPU fallback and NO_GPU override; GGML models auto-download on first
  start (MODEL env, default large-v3)
- API bound to the Tailscale interface only (100.103.83.12:8080) since
  whisper-server has no authentication; render-group GID passthrough for
  /dev/dri
- validated locally: image builds, entrypoint downloads tiny, POST
  /inference returns verbose_json with language + segments; GPU-less
  fallback confirmed
2026-09-07 12:17:40 +02:00

43 lines
1.6 KiB
Docker

# whisper.cpp inference server for meetrec.
#
# Built from the same pinned whisper.cpp release (v1.9.3) as the Android
# app's JNI layer, compiled statically WITH the Vulkan GPU backend for
# AMD GPUs (Radeon AI PRO R9700 / RDNA, also NVIDIA/Intel). Without a GPU
# present it transparently falls back to CPU.
#
# Note: ggml builds with -march=native by default, so build the image ON
# the machine that will run it (docker compose build on the server).
FROM debian:12-slim AS build
RUN apt-get update && apt-get install -y --no-install-recommends \
git cmake build-essential ca-certificates curl \
libvulkan-dev glslang-tools \
&& rm -rf /var/lib/apt/lists/*
ARG WHISPER_TAG=v1.9.3
RUN git clone --depth 1 --branch ${WHISPER_TAG} \
https://github.com/ggml-org/whisper.cpp /src
RUN cmake -S /src -B /src/build -DCMAKE_BUILD_TYPE=Release \
-DBUILD_SHARED_LIBS=OFF \
-DWHISPER_BUILD_EXAMPLES=ON \
-DWHISPER_BUILD_TESTS=OFF \
-DWHISPER_BUILD_SERVER=ON \
-DWHISPER_VULKAN=ON \
&& cmake --build /src/build --target whisper-server -j"$(nproc)"
FROM debian:12-slim
# libvulkan1 + mesa-vulkan-drivers: the AMD RADV Vulkan driver used by
# the R9700. GPU access is granted via /dev/dri in docker-compose.yml.
RUN apt-get update && apt-get install -y --no-install-recommends \
libgomp1 ca-certificates curl libvulkan1 mesa-vulkan-drivers \
&& rm -rf /var/lib/apt/lists/*
COPY --from=build /src/build/bin/whisper-server /usr/local/bin/whisper-server
COPY entrypoint.sh /usr/local/bin/entrypoint.sh
RUN chmod +x /usr/local/bin/entrypoint.sh
EXPOSE 8080
ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]