File size: 1,727 Bytes
aa855d8
 
 
 
 
 
29eda7d
 
 
aa855d8
 
 
 
 
 
 
 
 
 
 
 
 
 
 
6efd5e4
 
aa855d8
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
6efd5e4
aa855d8
 
 
 
 
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
#
#	Fast Whisper Prepared to Hugging Face Docker!
#		This file builds a fasst whisper that can run in Hugging Face Docker Space.
#		HF Docker Space runs under user 1000, due this, some changes is need in build.
#
#



FROM alpine/git as src

	WORKDIR /src
	RUN git clone https://github.com/fedirz/faster-whisper-server .


FROM nvidia/cuda:12.2.2-cudnn8-runtime-ubuntu22.04

	RUN apt-get update 
	RUN apt install -y software-properties-common
	RUN add-apt-repository ppa:deadsnakes/ppa


	ENV DEBIAN_FRONTEND=noninteractive
	RUN apt-get install -y --no-install-recommends make build-essential libssl-dev zlib1g-dev libbz2-dev libreadline-dev libsqlite3-dev wget ca-certificates curl llvm libncurses5-dev xz-utils tk-dev libxml2-dev libxmlsec1-dev libffi-dev liblzma-dev mecab-ipadic-utf8 git
	RUN apt-get install -y ffmpeg software-properties-common
	
	RUN useradd -m -u 1000 user
	USER user

	WORKDIR /pyenv


	ENV PYENV_ROOT /pyenv/pyenvroot
	ENV PATH $PYENV_ROOT/shims:$PYENV_ROOT/bin:$PATH

	ENV PYTHON_VERSION 3.12

	RUN set -ex \

		&& curl https://pyenv.run | bash \
		&& pyenv update \
		&& pyenv install $PYTHON_VERSION \
		&& pyenv global $PYTHON_VERSION \
		&& pyenv rehash


	WORKDIR /server


	RUN pip install --no-cache-dir --upgrade pip
	WORKDIR /app
	COPY --chown=user --from=src /src/requirements.txt .
	COPY --chown=user --from=src /src/faster_whisper_server ./faster_whisper_server

	RUN pip install -r requirements.txt
	RUN pip install uvicorn
	
	ENV WHISPER__MODEL=Systran/faster-whisper-small
	ENV WHISPER__INFERENCE_DEVICE=auto
	ENV UVICORN_HOST=0.0.0.0
	ENV UVICORN_PORT=8000
	CMD ["python3.12","-m","uvicorn", "faster_whisper_server.main:app"]