Skip to content

Commit cccad3e

Browse files
authored
Docker overhaul. (#1100)
* Changed deprecated `huggingface-cli` command to `hf`. * Updated version of pyproject.toml and dockerfiles for GPU support. * Updated uv.lock to the latest versions. * Enhanced Dockerfile - added multi-targets for web UI or server - added multi-backend support - improved dependency installation with caching - added non-root user - implemented health checks for web UI and API server - added dynamic entrypoint creation - added environment validation. * Added docker compose files. Extended .dockerignore file. * Updated inference and install docs for docker and uv. Fixed warnings in pyproject.toml * Removed old docker files. * Pre-commit fixes and uv.lock update. * Updated default CUDA version to 12.6.0 and backend to cuda.
1 parent b25daed commit cccad3e

16 files changed

Lines changed: 4113 additions & 2323 deletions

.dockerignore

Lines changed: 165 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,166 @@
1+
# .dockerignore
2+
3+
# Git and version control
14
.git
2-
.github
3-
results
4-
data
5-
*.filelist
6-
/data_server/target
7-
checkpoints
5+
.gitignore
6+
.gitattributes
7+
.gitmodules
8+
9+
# Documentation
10+
*.md
11+
docs/
12+
!README*
13+
LICENSE*
14+
CHANGELOG*
15+
16+
# IDE and editor files
17+
.vscode/
18+
.idea/
19+
*.swp
20+
*.swo
21+
*~
22+
.DS_Store
23+
Thumbs.db
24+
25+
# Python cache and build artifacts
26+
__pycache__/
27+
*.py[cod]
28+
*$py.class
29+
*.so
30+
.Python
31+
build/
32+
develop-eggs/
33+
dist/
34+
downloads/
35+
eggs/
36+
.eggs/
37+
lib/
38+
lib64/
39+
parts/
40+
sdist/
41+
var/
42+
wheels/
43+
*.egg-info/
44+
.installed.cfg
45+
*.egg
46+
MANIFEST
47+
48+
# Virtual environments
49+
venv/
50+
env/
51+
ENV/
52+
.venv/
53+
.env/
54+
55+
# Testing
56+
.pytest_cache/
57+
.coverage
58+
htmlcov/
59+
.tox/
60+
.nox/
61+
coverage.xml
62+
*.cover
63+
.hypothesis/
64+
65+
# Jupyter Notebook
66+
.ipynb_checkpoints
67+
*.ipynb
68+
69+
# Logs
70+
*.log
71+
logs/
72+
73+
# Temporary files
74+
tmp/
75+
temp/
76+
*.tmp
77+
*.temp
78+
79+
# OS generated files
80+
.DS_Store
81+
.DS_Store?
82+
._*
83+
.Spotlight-V100
84+
.Trashes
85+
ehthumbs.db
86+
Thumbs.db
87+
88+
# Docker files (except the one being used)
89+
docker/
90+
Dockerfile*
91+
docker-compose*.yml
92+
.dockerignore
93+
94+
# Checkpoints and models (should be mounted)
95+
checkpoints/
96+
models/
97+
*.pth
98+
*.ckpt
99+
*.safetensors
100+
*.bin
101+
102+
# Reference voices (should be mounted)
103+
references/
104+
105+
# Generated audio files
106+
*.wav
107+
*.mp3
108+
*.flac
109+
*.ogg
110+
generated_audio.wav
111+
fake.wav
112+
fake.npy
113+
114+
# Cache directories
115+
.cache/
116+
cache/
117+
.uv_cache/
118+
119+
# Development files
120+
.env
121+
.env.local
122+
.env.development
123+
.env.test
124+
.env.production
125+
126+
# Test files
127+
test_*.py
128+
*_test.py
129+
tests/
130+
131+
# CI/CD
132+
.github/
133+
.gitlab-ci.yml
134+
.travis.yml
135+
.circleci/
136+
azure-pipelines.yml
137+
138+
# Monitoring and profiling
139+
.prof
140+
*.prof
141+
142+
# Backup files
143+
*.bak
144+
*.backup
145+
*.old
146+
147+
# Large data files
148+
*.csv
149+
*.json
150+
*.jsonl
151+
*.parquet
152+
*.h5
153+
*.hdf5
154+
155+
# Audio processing temporary files
156+
*.tmp.wav
157+
*.temp.wav
158+
159+
# OLD:
160+
# .github
161+
# results
162+
# data
163+
# *.filelist
164+
# /data_server/target
165+
# checkpoints
166+
# .venv

compose.base.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
services:
2+
app-base:
3+
build:
4+
context: .
5+
dockerfile: docker/Dockerfile
6+
args:
7+
BACKEND: ${BACKEND:-cuda} # or cpu
8+
UV_VERSION: ${UV_VERSION:-0.8.15}
9+
volumes:
10+
- ./checkpoints:/app/checkpoints
11+
- ./references:/app/references
12+
environment:
13+
COMPILE: ${COMPILE:-0}
14+
# GPU (remove this block if CPU-only):
15+
deploy:
16+
resources:
17+
reservations:
18+
devices:
19+
- driver: nvidia
20+
count: all
21+
capabilities: [gpu]
22+
tty: true
23+
stdin_open: true

compose.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: fish-speech
2+
3+
services:
4+
webui:
5+
extends:
6+
file: compose.base.yml
7+
service: app-base
8+
build:
9+
target: webui
10+
environment:
11+
COMPILE: ${COMPILE:-0}
12+
profiles: ["webui"]
13+
ports:
14+
- "${GRADIO_PORT:-7860}:7860"
15+
16+
server:
17+
extends:
18+
file: compose.base.yml
19+
service: app-base
20+
build:
21+
target: server
22+
environment:
23+
COMPILE: ${COMPILE:-0}
24+
profiles: ["server"]
25+
ports:
26+
- "${API_PORT:-8080}:8080"

docker-compose.dev.yml

Lines changed: 0 additions & 18 deletions
This file was deleted.

0 commit comments

Comments
 (0)