forked from Nyralei/whisperx-api-server
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile.cuda
More file actions
56 lines (36 loc) · 1.33 KB
/
Dockerfile.cuda
File metadata and controls
56 lines (36 loc) · 1.33 KB
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
ARG UBUNTU_VERSION=22.04
ARG CUDA_VERSION=13.0.2
ARG BASE_CUDA_RUN_CONTAINER=nvidia/cuda:${CUDA_VERSION}-cudnn-runtime-ubuntu${UBUNTU_VERSION}
FROM ${BASE_CUDA_RUN_CONTAINER} AS base
ENV DEBIAN_FRONTEND=noninteractive
ENV LD_LIBRARY_PATH="/usr/lib/x86_64-linux-gnu:${LD_LIBRARY_PATH}"
RUN apt-get update && apt-get install -y --no-install-recommends \
build-essential \
ca-certificates \
curl \
ffmpeg \
git \
python3 \
python3-pip \
python3-venv \
&& rm -rf /var/lib/apt/lists/* /var/cache/apt/archives/*
WORKDIR /workspace
FROM base AS python-env
RUN python3 -m venv /workspace/venv
ENV PATH="/workspace/venv/bin:$PATH"
COPY requirements-cuda.txt ./
RUN pip install --upgrade pip && \
pip install --no-cache-dir -r requirements-cuda.txt
COPY requirements.txt constraints.txt ./
RUN pip install --no-cache-dir -c constraints.txt -r requirements.txt
FROM base AS runtime
COPY --from=python-env /workspace/venv /workspace/venv
ENV PATH="/workspace/venv/bin:$PATH"
WORKDIR /workspace
COPY src/whisperx_api_server ./whisperx_api_server
ENV UVICORN_HOST=0.0.0.0
ENV UVICORN_PORT=8000
COPY ./cuda-docker-entrypoint.sh /workspace/docker-entrypoint.sh
RUN chmod +x /workspace/docker-entrypoint.sh
ENTRYPOINT [ "/workspace/docker-entrypoint.sh" ]
CMD ["uvicorn", "--factory", "whisperx_api_server.main:create_app"]