Skip to content

Commit 599faad

Browse files
authored
Update docker-compose.yml
1 parent 6d49119 commit 599faad

File tree

1 file changed

+31
-9
lines changed

1 file changed

+31
-9
lines changed

docker-compose.yml

Lines changed: 31 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,40 @@ services:
88
ports:
99
- "${PORT:-8003}:${PORT:-8003}"
1010
volumes:
11+
# Mount local directories into the container for persistent data
1112
- ./model_cache:/app/model_cache
1213
- ./reference_audio:/app/reference_audio
1314
- ./outputs:/app/outputs
1415
- ./voices:/app/voices
15-
- ./config.yaml:/app/config.yaml
16-
deploy:
17-
resources:
18-
reservations:
19-
devices:
20-
- driver: nvidia
21-
count: 1
22-
capabilities: [gpu]
16+
# DO NOT mount config.yaml - let the app create it inside
17+
18+
# --- GPU Access ---
19+
# Modern method (Recommended for newer Docker/NVIDIA setups)
20+
devices:
21+
- nvidia.com/gpu=all
22+
device_cgroup_rules:
23+
- "c 195:* rmw" # Needed for some NVIDIA container toolkit versions
24+
- "c 236:* rmw" # Needed for some NVIDIA container toolkit versions
25+
26+
# Legacy method (Alternative for older Docker/NVIDIA setups)
27+
# If the 'devices' block above doesn't work, comment it out and uncomment
28+
# the 'deploy' block below. Do not use both simultaneously.
29+
# deploy:
30+
# resources:
31+
# reservations:
32+
# devices:
33+
# - driver: nvidia
34+
# count: 1 # Or specify specific GPUs e.g., "device=0,1"
35+
# capabilities: [gpu]
36+
# --- End GPU Access ---
37+
2338
restart: unless-stopped
2439
env_file:
25-
- .env
40+
# Load environment variables from .env file for initial config seeding
41+
- .env
42+
environment:
43+
# Enable faster Hugging Face downloads inside the container
44+
- HF_HUB_ENABLE_HF_TRANSFER=1
45+
# Pass GPU capabilities (may be needed for legacy method if uncommented)
46+
- NVIDIA_VISIBLE_DEVICES=all
47+
- NVIDIA_DRIVER_CAPABILITIES=compute,utility

0 commit comments

Comments
 (0)