File size: 890 Bytes
c5f1d8d
587cd5c
c5f1d8d
 
 
 
 
 
 
587cd5c
c5f1d8d
5749c4e
2bc33df
c5f1d8d
 
 
 
 
 
 
 
587cd5c
c5f1d8d
 
 
 
 
 
 
587cd5c
f22431f
c5f1d8d
 
 
 
 
973e473
c5f1d8d
587cd5c
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
FROM python:3.10-slim

WORKDIR /app

# System deps for audio processing
RUN apt-get update && apt-get install -y \
    ffmpeg \
    libsndfile1 \
    && rm -rf /var/lib/apt/lists/*

# Create user (HF requires user ID 1000)
RUN useradd -m -u 1000 user

# Install torch CPU-only first (much smaller than CUDA version)
RUN pip install --no-cache-dir --upgrade pip && \
    pip install --no-cache-dir torch>=2.5.0 torchaudio>=2.5.0 \
    --index-url https://download.pytorch.org/whl/cpu

# Install other deps
COPY requirements_docker.txt /tmp/requirements.txt
RUN pip install --no-cache-dir -r /tmp/requirements.txt

# Copy app
COPY app.py .
COPY reference_one.wav /data/reference_one.wav

# Permissions
RUN mkdir -p /data/output && \
    chown -R user:user /data /app

USER user

ENV PYTHONUNBUFFERED=1 \
    PYTHONIOENCODING=UTF-8 \
    HOME=/home/user

EXPOSE 7860

CMD ["python", "app.py"]