Repository navigation
Expand file tree
/
Copy pathDockerfile.cuda
More file actions
66 lines (57 loc) · 2.48 KB
/
Copy pathDockerfile.cuda
File metadata and controls
66 lines (57 loc) · 2.48 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
57
58
59
60
61
62
63
64
65
66
#
# Copyright (C) 2026 Lin Song <linsongui@gmail.com>
#
# This work is licensed under the MIT License
# See: https://opensource.org/licenses/MIT
FROM nvidia/cuda:12.9.2-cudnn-runtime-ubuntu24.04
WORKDIR /opt/src
ENV PYTHONDONTWRITEBYTECODE=1 \
PYTHONUNBUFFERED=1 \
PATH="/opt/venv/bin:$PATH"
# faster-whisper decodes audio via the PyAV library (bundled FFmpeg libraries).
# PyAV 19 removed metadata_errors, which faster-whisper's decoder still uses.
# curl is used by run.sh for the public-IP lookup and the health-check poll.
RUN set -x \
&& apt-get update \
&& apt-get install -y --no-install-recommends ca-certificates curl bzip2 python3 python3-venv \
&& python3 -m venv /opt/venv \
&& pip install --no-cache-dir --upgrade pip \
&& pip install --no-cache-dir --uploaded-prior-to P7D \
faster-whisper \
"av>=11,<19" \
fastapi \
"uvicorn[standard]" \
python-multipart \
sherpa-onnx \
&& apt-get autoremove -y \
&& rm -rf /var/lib/apt/lists/* \
&& find /opt/venv -name '*.pyi' -delete \
&& { find /opt/venv -type d -name '__pycache__' -exec rm -rf {} + 2>/dev/null || true; } \
&& mkdir -p /var/lib/whisper
COPY ./run.sh /opt/src/run.sh
COPY ./manage.sh /opt/src/manage.sh
COPY ./api_server.py /opt/src/api_server.py
COPY ./diarizer.py /opt/src/diarizer.py
COPY ./diarization_models.py /opt/src/diarization_models.py
COPY ./LICENSE.md /opt/src/LICENSE.md
RUN chmod 755 /opt/src/run.sh /opt/src/manage.sh \
&& ln -s /opt/src/manage.sh /usr/local/bin/whisper_manage
ENV TMPDIR="/run/whisper-temp"
EXPOSE 9000/tcp
VOLUME ["/var/lib/whisper"]
CMD ["/opt/src/run.sh"]
ARG BUILD_DATE
ARG VERSION
ARG VCS_REF
ENV IMAGE_VER=$BUILD_DATE
ENV IMAGE_FLAVOR=$VERSION
LABEL maintainer="Lin Song <linsongui@gmail.com>" \
org.opencontainers.image.created="$BUILD_DATE" \
org.opencontainers.image.version="$VERSION" \
org.opencontainers.image.revision="$VCS_REF" \
org.opencontainers.image.authors="Lin Song <linsongui@gmail.com>" \
org.opencontainers.image.title="ScribeCrate (CUDA)" \
org.opencontainers.image.description="ScribeCrate: self-hosted transcription and English translation API powered by faster-whisper, with OpenAI-compatible endpoints and NVIDIA GPU acceleration." \
org.opencontainers.image.url="https://github.com/hwdsl2/scribecrate" \
org.opencontainers.image.source="https://github.com/hwdsl2/scribecrate" \
org.opencontainers.image.documentation="https://github.com/hwdsl2/scribecrate"