File size: 1,332 Bytes
c4b1cb5
ca200bf
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
c4b1cb5
ca200bf
 
 
 
 
 
 
 
 
 
 
 
 
 
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
42
43
44
45
46
47
48
# Generated at 2026-01-29T20:46:31Z from templates/space/Dockerfile.j2
#
# TorToise HuggingFace Space - Dockerfile
# Uses Docker SDK for more control over dependencies and environment

FROM python:3.10-slim

# Install system dependencies (as root)
RUN apt-get update && apt-get install -y --no-install-recommends \
    git \
    git-lfs \
    libsox-dev \
    ffmpeg \
    gcc \
    build-essential \
    g++-12 \
    espeak-ng

# Set up user (UID 1000 as required by HuggingFace Spaces)
RUN useradd -m -u 1000 user
USER user
ENV HOME=/home/user \
    PATH=/home/user/.local/bin:$PATH
WORKDIR $HOME/app

# Upgrade pip
RUN pip install --no-cache-dir --upgrade pip

# Install PyTorch (CPU version for Spaces - GPU available at runtime if hardware supports it)
RUN pip install --no-cache-dir torch torchaudio --index-url https://download.pytorch.org/whl/cpu

# Install the external PyPI package (if specified) and the ttsdb wrapper from PyPI
RUN pip install --no-cache-dir ttsdb_tortoise==0.1.1

# Install Gradio
RUN pip install --no-cache-dir gradio>=5.15.0

# Copy the app
COPY --chown=user app.py $HOME/app/
# Copy packaged audio examples into the app examples directory (if present)
COPY --chown=user examples $HOME/app/examples

# Expose port (HuggingFace Spaces will map this)
EXPOSE 7860

# Run the app
CMD ["python", "app.py"]