From ee0ba8eaff80e61a70b71ff8b78e5f52ba1866a5 Mon Sep 17 00:00:00 2001 From: Kar l5 Date: Sun, 15 Jun 2025 23:00:18 +0530 Subject: [PATCH] v3 --- Dockerfile | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/Dockerfile b/Dockerfile index 0b4d1d2..2019e8b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -15,11 +15,16 @@ RUN apt-get update && apt-get install -y \ libswresample-dev \ && rm -rf /var/lib/apt/lists/* -# Clone and build whisper.cpp +# Clone whisper.cpp (use specific known-working commit) RUN git clone https://github.com/ggerganov/whisper.cpp.git /whisper.cpp WORKDIR /whisper.cpp +# Checkout a stable commit if needed +# RUN git checkout 5a8b1b4 RUN make +# Verify main executable was built +RUN ls -lh main && file main + FROM ubuntu:22.04 AS runtime # Install runtime dependencies @@ -33,11 +38,13 @@ RUN apt-get update && apt-get install -y \ libswresample-dev \ && rm -rf /var/lib/apt/lists/* -# Copy whisper.cpp executable -COPY --from=builder /whisper.cpp/main /whisper.cpp/main +# Create directory structure first +RUN mkdir -p /whisper.cpp -# Create models directory and copy your local model -RUN mkdir -p /whisper.cpp/models +# Copy the entire whisper.cpp directory (includes main executable and required files) +COPY --from=builder /whisper.cpp /whisper.cpp + +# Copy your local model COPY model/ggml-tiny.en.bin /whisper.cpp/models/ggml-tiny.en.bin WORKDIR /whisper.cpp @@ -48,8 +55,9 @@ RUN pip3 install flask flask-cors # Copy API server script COPY app.py . -# Expose port -EXPOSE 4002 +# Verify files exist +RUN ls -lh main models/ggml-tiny.en.bin + +EXPOSE 5000 -# Run the server CMD ["python3", "app.py"]