File size: 1,270 Bytes
cc17cd1
 
 
 
 
45dc1cf
cc17cd1
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
640d394
 
cc17cd1
640d394
 
 
cc17cd1
 
 
 
 
 
 
f12ab63
d456e9e
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
38
39
40
41
# Voice Cloner - Docker image for Render (CPU)
FROM python:3.12-slim

WORKDIR /app

# Install system deps: espeak-ng for phonemizer, libsndfile for soundfile
RUN apt-get update && apt-get install -y --no-install-recommends \
    espeak-ng \
    libespeak-ng-dev \
    libsndfile1 \
    && rm -rf /var/lib/apt/lists/*

# Point phonemizer at espeak-ng (Debian/Ubuntu path)
ENV PHONEMIZER_ESPEAK_LIBRARY=/usr/lib/x86_64-linux-gnu/libespeak-ng.so

# Hugging Face cache (writable at runtime)
ENV HF_HOME=/app/.hf_cache
ENV HUGGINGFACE_HUB_CACHE=/app/.hf_cache/hub
ENV HF_HUB_DISABLE_SYMLINKS_WARNING=1
ENV PYTORCH_CUDA_ALLOC_CONF=expandable_segments:True

# No GPU on Render
ENV CUDA_VISIBLE_DEVICES=""
# So Render logs show startup output immediately
ENV PYTHONUNBUFFERED=1

# Install CPU-only torch stack first, then project deps.
# This avoids CUDA-linked wheels that fail with libcudart.so.* on CPU Spaces.
COPY requirements.txt .
RUN pip install --no-cache-dir --index-url https://download.pytorch.org/whl/cpu \
    torch==2.8.0 torchaudio==2.8.0 \
    && pip install --no-cache-dir -r requirements.txt

COPY . .

# Create dirs the app expects
RUN mkdir -p samples .hf_cache/hub

# Render sets PORT; app reads it and binds to 0.0.0.0
EXPOSE 7860
CMD ["python", "app.py"]