File size: 901 Bytes
3117187
 
f4fd0b5
 
 
 
90eb14c
3117187
f4fd0b5
a59c309
 
f4fd0b5
6f41de5
f4fd0b5
aa8694c
 
a59c309
aa8694c
3117187
 
f4fd0b5
3117187
 
f4fd0b5
 
 
 
3117187
 
aa8694c
 
90eb14c
f4fd0b5
3117187
 
f4fd0b5
3117187
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
FROM python:3.9-slim

# 1. Install system dependencies
RUN apt-get update && apt-get install -y \
    espeak-ng \
    libsndfile1 \
    git

# 2. Configure environment
ENV HF_HOME=/app/cache \
    XDG_CACHE_HOME=/app/cache \
    PYTHONPATH="${PYTHONPATH}:/app"

# 3. Create directories with proper permissions
RUN mkdir -p /app/cache/hub && \
    mkdir -p /app/cache/hub/models--hexgrad--Kokoro-82M && \
    chmod -R 777 /app

WORKDIR /app

# 4. Install Python dependencies
COPY requirements.txt .

# First install setup tools
RUN pip install --upgrade pip setuptools wheel

# Then install other requirements
RUN pip install --no-cache-dir -r requirements.txt

# Pre-download the model
RUN python -c "from huggingface_hub import hf_hub_download; hf_hub_download('hexgrad/Kokoro-82M', 'config.json')"

# 5. Copy application code
COPY . .

# 6. Run FastAPI
CMD uvicorn app:app --host 0.0.0.0 --port 7860