master
parent
cff5634ac1
commit
ee0ba8eaff
24
Dockerfile
24
Dockerfile
|
@ -15,11 +15,16 @@ RUN apt-get update && apt-get install -y \
|
||||||
libswresample-dev \
|
libswresample-dev \
|
||||||
&& rm -rf /var/lib/apt/lists/*
|
&& 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
|
RUN git clone https://github.com/ggerganov/whisper.cpp.git /whisper.cpp
|
||||||
WORKDIR /whisper.cpp
|
WORKDIR /whisper.cpp
|
||||||
|
# Checkout a stable commit if needed
|
||||||
|
# RUN git checkout 5a8b1b4
|
||||||
RUN make
|
RUN make
|
||||||
|
|
||||||
|
# Verify main executable was built
|
||||||
|
RUN ls -lh main && file main
|
||||||
|
|
||||||
FROM ubuntu:22.04 AS runtime
|
FROM ubuntu:22.04 AS runtime
|
||||||
|
|
||||||
# Install runtime dependencies
|
# Install runtime dependencies
|
||||||
|
@ -33,11 +38,13 @@ RUN apt-get update && apt-get install -y \
|
||||||
libswresample-dev \
|
libswresample-dev \
|
||||||
&& rm -rf /var/lib/apt/lists/*
|
&& rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
# Copy whisper.cpp executable
|
# Create directory structure first
|
||||||
COPY --from=builder /whisper.cpp/main /whisper.cpp/main
|
RUN mkdir -p /whisper.cpp
|
||||||
|
|
||||||
# Create models directory and copy your local model
|
# Copy the entire whisper.cpp directory (includes main executable and required files)
|
||||||
RUN mkdir -p /whisper.cpp/models
|
COPY --from=builder /whisper.cpp /whisper.cpp
|
||||||
|
|
||||||
|
# Copy your local model
|
||||||
COPY model/ggml-tiny.en.bin /whisper.cpp/models/ggml-tiny.en.bin
|
COPY model/ggml-tiny.en.bin /whisper.cpp/models/ggml-tiny.en.bin
|
||||||
|
|
||||||
WORKDIR /whisper.cpp
|
WORKDIR /whisper.cpp
|
||||||
|
@ -48,8 +55,9 @@ RUN pip3 install flask flask-cors
|
||||||
# Copy API server script
|
# Copy API server script
|
||||||
COPY app.py .
|
COPY app.py .
|
||||||
|
|
||||||
# Expose port
|
# Verify files exist
|
||||||
EXPOSE 4002
|
RUN ls -lh main models/ggml-tiny.en.bin
|
||||||
|
|
||||||
|
EXPOSE 5000
|
||||||
|
|
||||||
# Run the server
|
|
||||||
CMD ["python3", "app.py"]
|
CMD ["python3", "app.py"]
|
||||||
|
|
Loading…
Reference in New Issue