From 5f21ed8fc47b4e1506670cc7e896f9c981f01c09 Mon Sep 17 00:00:00 2001 From: Kar l5 Date: Sun, 15 Jun 2025 22:48:02 +0530 Subject: [PATCH] v3 --- Dockerfile | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/Dockerfile b/Dockerfile index 5274ef4..7a9bb02 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,30 +1,29 @@ -FROM ubuntu:22.04 AS build +FROM ubuntu:22.04 AS builder # Install build dependencies RUN apt-get update && apt-get install -y \ git \ - wget \ cmake \ make \ g++ \ python3 \ python3-pip \ ffmpeg \ + wget \ libavcodec-dev \ libavformat-dev \ libavutil-dev \ libswresample-dev \ && rm -rf /var/lib/apt/lists/* -# Clone whisper.cpp +# Clone and build whisper.cpp RUN git clone https://github.com/ggerganov/whisper.cpp.git /whisper.cpp WORKDIR /whisper.cpp - -# Build whisper.cpp RUN make -# Download a model (base.en in this example) -RUN ./models/download-ggml-model.sh base.en +# Download model +RUN mkdir -p models && \ + wget https://huggingface.co/datasets/ggerganov/whisper.cpp/resolve/main/ggml-base.en.bin -O models/ggml-base.en.bin FROM ubuntu:22.04 AS runtime @@ -39,8 +38,9 @@ RUN apt-get update && apt-get install -y \ libswresample-dev \ && rm -rf /var/lib/apt/lists/* -# Copy built whisper.cpp and model -COPY --from=build /whisper.cpp /whisper.cpp +# Copy only necessary files from builder +COPY --from=builder /whisper.cpp/main /whisper.cpp/main +COPY --from=builder /whisper.cpp/models /whisper.cpp/models WORKDIR /whisper.cpp # Install Python dependencies