Background / Dockerfile
carm5333's picture
S212: add git to apt-get install (needed for pip git+https installs)
13ade65 verified
Raw
History Blame Contribute Delete
758 Bytes
FROM python:3.11-slim
RUN apt-get update && apt-get install -y ffmpeg git && rm -rf /var/lib/apt/lists/*
WORKDIR /app
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
# S202: pre-download VoiceFixer weights at build time, not job time
RUN python3 -c "from voicefixer import VoiceFixer; VoiceFixer()" || echo 'VoiceFixer pre-warm failed — will retry at runtime (slower first job)'
COPY . .
RUN chmod +x /app/deep-filter || true
# S184/S185: pre-warm DF3 model into image so runtime never downloads
RUN ffmpeg -f lavfi -i "anullsrc=r=48000:cl=mono" -t 2 /tmp/df_warm.wav -y 2>/dev/null && \
/app/deep-filter -o /tmp /tmp/df_warm.wav 2>&1 || true && \
rm -f /tmp/df_warm.wav /tmp/in.wav
EXPOSE 7860
CMD ["python3", "app.py"]