File size: 1,084 Bytes
56aa734
 
 
 
 
 
 
 
595b296
63d8690
56aa734
 
 
 
 
 
 
fdbe523
 
 
 
56aa734
fdbe523
 
 
 
 
56aa734
595b296
63d8690
fdbe523
7419e5c
fdbe523
56aa734
 
fdbe523
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
FROM python:3.10 as build
RUN apt-get update
RUN mkdir /whisper && \
  wget -q https://github.com/ggerganov/whisper.cpp/tarball/master -O - | \
  tar -xz -C /whisper --strip-components 1

WORKDIR /whisper

ARG model=small-q5_1
RUN bash ./models/download-ggml-model.sh "${model}"
RUN make main

FROM python:3.10 as whisper
RUN apt-get update \
 && apt-get install -y libsdl2-dev alsa-utils ffmpeg \
 && apt-get clean \
 && rm -rf /var/lib/apt/lists/*
RUN useradd -m -u 1000 user
USER user
ENV HOME=/home/user \
	PATH=/home/user/.local/bin:$PATH

WORKDIR $HOME/root
COPY --chown=user requirements.txt $HOME/root
RUN pip install -r $HOME/root/requirements.txt
COPY --chown=user main.py $HOME/root
COPY --chown=user youtubeaudio.py $HOME/root

ARG model=small-q5_1
ENV model=$model
RUN mkdir $HOME/root/models
RUN mkdir -p -m 775 /tmp/holosubs/tracks /tmp/holosubs/videos
COPY --from=build "/whisper/models/ggml-${model}.bin" "${HOME}/root/models/ggml-${model}.bin"
COPY --from=build /whisper/main /usr/local/bin/whisper

CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]