-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile
More file actions
51 lines (39 loc) · 1.59 KB
/
Copy pathDockerfile
File metadata and controls
51 lines (39 loc) · 1.59 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
# F5-TTS Server — production-ready container.
# Two stages: builder pulls Python deps, runtime ships minimal CUDA + the app.
# For CPU-only or Apple Silicon, see docker-compose.cpu.yml or build with
# `--build-arg BASE_IMAGE=python:3.12-slim` (note: CPU inference RTF > 1 in tests).
ARG BASE_IMAGE=nvidia/cuda:12.8.0-runtime-ubuntu24.04
FROM ${BASE_IMAGE}
ENV DEBIAN_FRONTEND=noninteractive \
PYTHONUNBUFFERED=1 \
PIP_NO_CACHE_DIR=1 \
PIP_DISABLE_PIP_VERSION_CHECK=1
RUN apt-get update && apt-get install -y --no-install-recommends \
python3.12 python3.12-venv python3-pip \
libsndfile1 ffmpeg curl ca-certificates \
&& rm -rf /var/lib/apt/lists/*
RUN ln -sf /usr/bin/python3.12 /usr/bin/python3
WORKDIR /app
# Pin versions to match agoracosmica.org production. F5-TTS itself is pinned to
# 1.1.5 — that's where the F5TTS_Base config trap was verified safe.
COPY requirements.txt /app/requirements.txt
RUN pip3 install --no-cache-dir --break-system-packages -r /app/requirements.txt
COPY serve.py voices.json /app/
COPY refs/ /app/refs/
ENV MODELS_DIR=/models \
REF_DIR=/app/refs \
VOICES_FILE=/app/voices.json \
PORT=8000 \
HOST=0.0.0.0 \
F5_DEFAULT_CKPT=hvoss \
F5_DEFAULT_LANGUAGE=de \
F5_SPEED=1.0 \
OMP_NUM_THREADS=4 \
MKL_NUM_THREADS=4 \
CORS_ALLOW_ORIGINS=*
# Checkpoint cache. Mount a host volume here to persist across `docker compose down`.
VOLUME /models
EXPOSE 8000
HEALTHCHECK --interval=30s --timeout=10s --start-period=120s --retries=3 \
CMD curl -sf http://localhost:8000/health || exit 1
CMD ["python3", "serve.py"]