forked from fedirz/faster-whisper-server
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile.cuda
24 lines (24 loc) · 1.18 KB
/
Dockerfile.cuda
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
FROM nvidia/cuda:12.2.2-cudnn8-runtime-ubuntu22.04
# `ffmpeg` is installed because without it `gradio` won't work with mp3(possible others as well) files
# hadolint ignore=DL3008,DL3015,DL4006
RUN apt-get update && \
apt-get install -y ffmpeg software-properties-common && \
add-apt-repository ppa:deadsnakes/ppa && \
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends python3.12 python3.12-distutils && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
COPY --from=ghcr.io/astral-sh/uv:0.4.11 /uv /bin/uv
WORKDIR /root/faster-whisper-server
# https://docs.astral.sh/uv/guides/integration/docker/#intermediate-layers
RUN --mount=type=cache,target=/root/.cache/uv \
--mount=type=bind,source=uv.lock,target=uv.lock \
--mount=type=bind,source=pyproject.toml,target=pyproject.toml \
uv sync --frozen --no-install-project
COPY ./src ./pyproject.toml ./uv.lock ./
RUN --mount=type=cache,target=/root/.cache/uv \
uv sync --frozen --extra ui
ENV WHISPER__MODEL=Systran/faster-whisper-large-v3
ENV WHISPER__INFERENCE_DEVICE=auto
ENV UVICORN_HOST=0.0.0.0
ENV UVICORN_PORT=8000
CMD ["uv", "run", "uvicorn", "--factory", "faster_whisper_server.main:create_app"]