Kokoro-FastAPI/docker-compose.yml
2025-01-04 17:54:54 -07:00

59 lines
1.4 KiB
YAML

services:
model-fetcher:
image: datamachines/git-lfs:latest
volumes:
- ./Kokoro-82M:/app/Kokoro-82M
working_dir: /app/Kokoro-82M
command: >
sh -c "
rm -f .git/index.lock;
if [ -z \"$(ls -A .)\" ]; then
git clone https://huggingface.co/hexgrad/Kokoro-82M .
touch .cloned;
else
rm -f .git/index.lock && \
git checkout main && \
git pull origin main && \
touch .cloned;
fi;
tail -f /dev/null
"
healthcheck:
test: ["CMD", "test", "-f", ".cloned"]
interval: 5s
timeout: 2s
retries: 300
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
# # Gradio UI service [Comment out everything below if you don't need it]
# gradio-ui:
# build:
# context: ./ui
# ports:
# - "7860:7860"
# volumes:
# - ./ui/data:/app/ui/data
# - ./ui/app.py:/app/app.py # Mount app.py for hot reload
# environment:
# - GRADIO_WATCH=True # Enable hot reloading