forked from coqui-ai/TTS
-
Notifications
You must be signed in to change notification settings - Fork 288
Expand file tree
/
Copy pathDockerfile
More file actions
40 lines (31 loc) · 1.02 KB
/
Copy pathDockerfile
File metadata and controls
40 lines (31 loc) · 1.02 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
ARG BASE=nvidia/cuda:12.8.1-base-ubuntu24.04
FROM ${BASE}
ARG BASE=nvidia/cuda:12.8.1-base-ubuntu24.04
RUN apt-get update && apt-get upgrade -y
RUN apt-get install -y --no-install-recommends \
gcc g++ make python3 python3-dev \
espeak-ng libsndfile1-dev libc-dev && \
rm -rf /var/lib/apt/lists/*
# Install uv
COPY --from=ghcr.io/astral-sh/uv:0.8.15 /uv /uvx /bin/
ENV UV_NO_CACHE=1
RUN uv venv /opt/venv
ENV VIRTUAL_ENV=/opt/venv PATH="/opt/venv/bin:$PATH"
WORKDIR /app
# Install dependencies first for better caching
COPY pyproject.toml /app
RUN if echo "$BASE" | grep -q "cuda"; then \
UV_TORCH_BACKEND=cu128; \
else \
UV_TORCH_BACKEND=cpu; \
fi && \
uv pip install torch torchaudio torchcodec --torch-backend=${UV_TORCH_BACKEND} && \
uv pip install -r pyproject.toml --extra all
# Copy the rest of the application
COPY . /app
# Install the project
RUN uv pip install -e .
# Verify installation works
RUN uv run --active python -c "from TTS.api import TTS"
ENTRYPOINT ["tts"]
CMD ["--help"]