master
parent
0f5c41259b
commit
5f21ed8fc4
18
Dockerfile
18
Dockerfile
|
@ -1,30 +1,29 @@
|
||||||
FROM ubuntu:22.04 AS build
|
FROM ubuntu:22.04 AS builder
|
||||||
|
|
||||||
# Install build dependencies
|
# Install build dependencies
|
||||||
RUN apt-get update && apt-get install -y \
|
RUN apt-get update && apt-get install -y \
|
||||||
git \
|
git \
|
||||||
wget \
|
|
||||||
cmake \
|
cmake \
|
||||||
make \
|
make \
|
||||||
g++ \
|
g++ \
|
||||||
python3 \
|
python3 \
|
||||||
python3-pip \
|
python3-pip \
|
||||||
ffmpeg \
|
ffmpeg \
|
||||||
|
wget \
|
||||||
libavcodec-dev \
|
libavcodec-dev \
|
||||||
libavformat-dev \
|
libavformat-dev \
|
||||||
libavutil-dev \
|
libavutil-dev \
|
||||||
libswresample-dev \
|
libswresample-dev \
|
||||||
&& rm -rf /var/lib/apt/lists/*
|
&& 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
|
RUN git clone https://github.com/ggerganov/whisper.cpp.git /whisper.cpp
|
||||||
WORKDIR /whisper.cpp
|
WORKDIR /whisper.cpp
|
||||||
|
|
||||||
# Build whisper.cpp
|
|
||||||
RUN make
|
RUN make
|
||||||
|
|
||||||
# Download a model (base.en in this example)
|
# Download model
|
||||||
RUN ./models/download-ggml-model.sh base.en
|
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
|
FROM ubuntu:22.04 AS runtime
|
||||||
|
|
||||||
|
@ -39,8 +38,9 @@ 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 built whisper.cpp and model
|
# Copy only necessary files from builder
|
||||||
COPY --from=build /whisper.cpp /whisper.cpp
|
COPY --from=builder /whisper.cpp/main /whisper.cpp/main
|
||||||
|
COPY --from=builder /whisper.cpp/models /whisper.cpp/models
|
||||||
WORKDIR /whisper.cpp
|
WORKDIR /whisper.cpp
|
||||||
|
|
||||||
# Install Python dependencies
|
# Install Python dependencies
|
||||||
|
|
Loading…
Reference in New Issue