-
Notifications
You must be signed in to change notification settings - Fork 296
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
50 lines (45 loc) · 1.54 KB
/
docker-compose.yml
File metadata and controls
50 lines (45 loc) · 1.54 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
services:
chatterbox-tts-server:
build:
args:
# Can be nvidia or cpu; Default is Nvidia
- RUNTIME=nvidia
context: .
dockerfile: Dockerfile
ports:
- "${PORT:-8004}:8004"
volumes:
# Mount local config file for persistence
- ./config.yaml:/app/config.yaml
# Mount local directories for persistent app data
- ./voices:/app/voices
- ./reference_audio:/app/reference_audio
- ./outputs:/app/outputs
- ./logs:/app/logs
# Named volume for Hugging Face model cache to persist across container rebuilds
- hf_cache:/app/hf_cache
# --- GPU Support (NVIDIA) ---
# The 'deploy' key is the modern way to request GPU resources.
# If you get a 'CDI device injection failed' error, comment out the 'deploy' section
# and uncomment the 'runtime: nvidia' line below.
# Method 1: Modern Docker Compose (Recommended)
deploy:
resources:
reservations:
devices:
- driver: nvidia
count: 1
capabilities: [gpu]
# Method 2: Legacy Docker Compose (for older setups)
# runtime: nvidia
restart: unless-stopped
environment:
- HF_TOKEN=YOUR_TOKEN_HERE
# Enable faster Hugging Face downloads inside the container
- HF_HUB_ENABLE_HF_TRANSFER=1
# Make NVIDIA GPUs visible and specify capabilities for PyTorch
- NVIDIA_VISIBLE_DEVICES=all
- NVIDIA_DRIVER_CAPABILITIES=compute,utility
# Define the named volume for the Hugging Face cache
volumes:
hf_cache: