File size: 939 Bytes
172bc37
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
FROM pytorch/pytorch:2.9.1-cuda12.8-cudnn9-runtime

ENV DEBIAN_FRONTEND=noninteractive \
    PYTHONUNBUFFERED=1 \
    PIP_NO_CACHE_DIR=1 \
    PORT=7860 \
    INTERNAL_WS_HOST=127.0.0.1 \
    INTERNAL_WS_PORT=9000 \
    S2S_REPO_DIR=/opt/speech-to-speech

RUN apt-get update && apt-get install -y --no-install-recommends \
    git \
    ffmpeg \
    libsndfile1 \
    curl \
    ca-certificates \
    && rm -rf /var/lib/apt/lists/*

WORKDIR /app

COPY requirements.txt .
RUN pip install --upgrade pip setuptools wheel && \
    pip install -r requirements.txt && \
    pip install uv

# Clone speech-to-speech and install its dependencies the way the repo expects
RUN git clone https://github.com/huggingface/speech-to-speech.git ${S2S_REPO_DIR} && \
    cd ${S2S_REPO_DIR} && \
    uv sync --no-dev

COPY app /app/app

EXPOSE 7860

CMD ["uv", "run", "--directory", "/app", "uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "7860"]