File size: 806 Bytes
3dad81d
 
 
 
 
 
 
8eee24d
 
3dad81d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
FROM python:3.10-slim

WORKDIR /app

# Install system dependencies
RUN apt-get update && apt-get install -y \
    git \
    build-essential \
    ffmpeg \
    && rm -rf /var/lib/apt/lists/*

# Install uv for fast package management
COPY --from=ghcr.io/astral-sh/uv:latest /uv /bin/uv

# Copy project files
COPY pyproject.toml .
COPY README.md .
COPY pocket_tts ./pocket_tts

# Install dependencies
RUN uv pip install --system --no-cache -e .

# Create a non-root user (required for HF Spaces)
RUN useradd -m -u 1000 user
USER user
ENV HOME=/home/user \
    PATH=/home/user/.local/bin:$PATH

# Expose the port (HF Spaces uses 7860)
EXPOSE 7860

# Command to run the application
# Note: We bind to 0.0.0.0 and port 7860
CMD ["python", "-m", "pocket_tts.main", "serve", "--host", "0.0.0.0", "--port", "7860"]