master
Kar 2025-06-15 23:00:18 +05:30
parent cff5634ac1
commit ee0ba8eaff
1 changed files with 16 additions and 8 deletions

View File

@ -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"]