Kokoro-FastAPI/docker-compose.yml
2025-01-01 03:41:23 -07:00

44 lines
1 KiB
YAML

services:
model-fetcher:
image: datamachines/git-lfs:latest
volumes:
- ./Kokoro-82M:/app/Kokoro-82M
working_dir: /app/Kokoro-82M
command: >
sh -c "
if [ -z \"$(ls -A .)\" ]; then
git clone https://huggingface.co/hexgrad/Kokoro-82M . && \
git checkout 7e9ebc5be7f66a1843b585b63d19d55b5d58ce30;
touch .cloned;
else
touch .cloned;
fi;
tail -f /dev/null
"
healthcheck:
test: ["CMD", "test", "-f", ".cloned"]
interval: 1s
timeout: 1s
retries: 120
start_period: 1s
kokoro-tts:
build:
context: .
volumes:
- ./api/src:/app/api/src
- ./Kokoro-82M:/app/Kokoro-82M
ports:
- "8880:8880"
environment:
- PYTHONPATH=/app:/app/Kokoro-82M
deploy:
resources:
reservations:
devices:
- driver: nvidia
count: 1
capabilities: [gpu]
depends_on:
model-fetcher:
condition: service_healthy