mirror of
https://github.com/remsky/Kokoro-FastAPI.git
synced 2025-04-13 09:39:17 +00:00
fix: healthchecks and curl installation to Docker configurations
This commit is contained in:
parent
c3e18d069d
commit
ce63c8d131
4 changed files with 29 additions and 11 deletions
12
.gitignore
vendored
12
.gitignore
vendored
|
@ -27,13 +27,19 @@ ENV/
|
||||||
*.swo
|
*.swo
|
||||||
|
|
||||||
# Project specific
|
# Project specific
|
||||||
examples/
|
*examples/*.wav
|
||||||
|
*examples/*.pcm
|
||||||
|
*examples/*.mp3
|
||||||
|
*examples/*.flac
|
||||||
|
*examples/*.acc
|
||||||
|
*examples/*.ogg
|
||||||
|
|
||||||
Kokoro-82M/
|
Kokoro-82M/
|
||||||
ui/
|
ui/data
|
||||||
tests/
|
tests/
|
||||||
*.md
|
*.md
|
||||||
*.txt
|
*.txt
|
||||||
!requirements.txt
|
requirements.txt
|
||||||
|
|
||||||
# Docker
|
# Docker
|
||||||
Dockerfile*
|
Dockerfile*
|
||||||
|
|
|
@ -7,6 +7,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
|
||||||
espeak-ng \
|
espeak-ng \
|
||||||
git \
|
git \
|
||||||
libsndfile1 \
|
libsndfile1 \
|
||||||
|
curl \
|
||||||
&& apt-get clean \
|
&& apt-get clean \
|
||||||
&& rm -rf /var/lib/apt/lists/*
|
&& rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
|
|
|
@ -26,11 +26,12 @@ services:
|
||||||
start_period: 1s
|
start_period: 1s
|
||||||
|
|
||||||
kokoro-tts:
|
kokoro-tts:
|
||||||
image: ghcr.io/remsky/kokoro-fastapi-cpu:latest
|
|
||||||
|
# image: ghcr.io/remsky/kokoro-fastapi-cpu:latest
|
||||||
# Uncomment below (and comment out above) to build from source instead of using the released image
|
# Uncomment below (and comment out above) to build from source instead of using the released image
|
||||||
# build:
|
build:
|
||||||
# context: .
|
context: .
|
||||||
# dockerfile: Dockerfile.cpu
|
dockerfile: Dockerfile.cpu
|
||||||
volumes:
|
volumes:
|
||||||
- ./api/src:/app/api/src
|
- ./api/src:/app/api/src
|
||||||
- ./Kokoro-82M:/app/Kokoro-82M
|
- ./Kokoro-82M:/app/Kokoro-82M
|
||||||
|
@ -46,10 +47,17 @@ services:
|
||||||
- ONNX_MEMORY_PATTERN=true
|
- ONNX_MEMORY_PATTERN=true
|
||||||
- ONNX_ARENA_EXTEND_STRATEGY=kNextPowerOfTwo
|
- ONNX_ARENA_EXTEND_STRATEGY=kNextPowerOfTwo
|
||||||
|
|
||||||
|
healthcheck:
|
||||||
|
test: ["CMD", "curl", "-f", "http://localhost:8880/health"]
|
||||||
|
interval: 10s
|
||||||
|
timeout: 5s
|
||||||
|
retries: 30
|
||||||
|
start_period: 30s
|
||||||
depends_on:
|
depends_on:
|
||||||
model-fetcher:
|
model-fetcher:
|
||||||
condition: service_healthy
|
condition: service_healthy
|
||||||
|
|
||||||
|
|
||||||
# Gradio UI service [Comment out everything below if you don't need it]
|
# Gradio UI service [Comment out everything below if you don't need it]
|
||||||
gradio-ui:
|
gradio-ui:
|
||||||
image: ghcr.io/remsky/kokoro-fastapi-ui:latest
|
image: ghcr.io/remsky/kokoro-fastapi-ui:latest
|
||||||
|
@ -64,3 +72,6 @@ services:
|
||||||
environment:
|
environment:
|
||||||
- GRADIO_WATCH=True # Enable hot reloading
|
- GRADIO_WATCH=True # Enable hot reloading
|
||||||
- PYTHONUNBUFFERED=1 # Ensure Python output is not buffered
|
- PYTHONUNBUFFERED=1 # Ensure Python output is not buffered
|
||||||
|
depends_on:
|
||||||
|
kokoro-tts:
|
||||||
|
condition: service_healthy
|
||||||
|
|
|
@ -32,10 +32,10 @@ services:
|
||||||
start_period: 1s
|
start_period: 1s
|
||||||
|
|
||||||
kokoro-tts:
|
kokoro-tts:
|
||||||
image: ghcr.io/remsky/kokoro-fastapi-gpu:latest
|
# image: ghcr.io/remsky/kokoro-fastapi-gpu:latest
|
||||||
# Uncomment below (and comment out above) to build from source instead of using the released image
|
# Uncomment below (and comment out above) to build from source instead of using the released image
|
||||||
# build:
|
build:
|
||||||
# context: .
|
context: .
|
||||||
volumes:
|
volumes:
|
||||||
- ./api/src:/app/api/src
|
- ./api/src:/app/api/src
|
||||||
- ./Kokoro-82M:/app/Kokoro-82M
|
- ./Kokoro-82M:/app/Kokoro-82M
|
||||||
|
@ -51,7 +51,7 @@ services:
|
||||||
count: 1
|
count: 1
|
||||||
capabilities: [gpu]
|
capabilities: [gpu]
|
||||||
healthcheck:
|
healthcheck:
|
||||||
test: ["CMD", "curl", "-f", "http://localhost:8880/v1/audio/voices"]
|
test: ["CMD", "curl", "-f", "http://localhost:8880/health"]
|
||||||
interval: 10s
|
interval: 10s
|
||||||
timeout: 5s
|
timeout: 5s
|
||||||
retries: 30
|
retries: 30
|
||||||
|
|
Loading…
Add table
Reference in a new issue