This repository was archived by the owner on Mar 28, 2026. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile.gpu
More file actions
51 lines (38 loc) · 1.5 KB
/
Dockerfile.gpu
File metadata and controls
51 lines (38 loc) · 1.5 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
# Dockerfile.gpu - x86_64 with NVIDIA GPU support
FROM python:3.12-slim
LABEL org.opencontainers.image.source=https://github.com/dlaszlo/speech-service
# Set environment
ENV DEBIAN_FRONTEND=noninteractive
ENV PYTHONUNBUFFERED=1
WORKDIR /app
# Install system dependencies
RUN apt-get update && \
apt-get install -y --no-install-recommends \
espeak-ng \
curl \
ffmpeg \
&& \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
# Install uv
COPY --from=ghcr.io/astral-sh/uv:latest /uv /usr/local/bin/uv
# Copy requirements
COPY requirements/ /app/requirements/
# Install GPU dependencies using uv
ENV UV_SYSTEM_PYTHON=1
ENV UV_COMPILE_BYTECODE=1
# We rely on uv/pip to pull standard wheels including CUDA libs where defined in requirements/gpu.txt
RUN uv pip install --system --no-cache -r requirements/gpu.txt
# Add LD_LIBRARY_PATH for NVIDIA libraries (cuDNN, cuBLAS) installed via pip
ENV LD_LIBRARY_PATH="/usr/local/lib/python3.12/site-packages/nvidia/cudnn/lib:/usr/local/lib/python3.12/site-packages/nvidia/cublas/lib${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}"
# Copy source code
COPY . .
# Environment variables
ENV STT_MODEL_NAME="Systran/faster-distil-whisper-small.en"
ENV TTS_MODEL_NAME="hexgrad/Kokoro-82M"
ENV TTS_LANG_CODE="a"
ENV HF_HOME="/data/huggingface"
EXPOSE 8000
HEALTHCHECK --interval=30s --timeout=10s --start-period=60s --retries=3 \
CMD curl -f http://localhost:8000/health || exit 1
CMD ["uvicorn", "src.main:app", "--host", "0.0.0.0", "--port", "8000"]