File size: 724 Bytes
a5142b1
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
bc162b4
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
FROM python:3.11-slim

ENV PYTHONDONTWRITEBYTECODE=1 \
    PYTHONUNBUFFERED=1 \
    PIP_NO_CACHE_DIR=1

WORKDIR /app

# ffmpeg/ffprobe are required by the translation pipeline.
RUN apt-get update && apt-get install -y --no-install-recommends ffmpeg && rm -rf /var/lib/apt/lists/*

COPY requirements.txt .
RUN pip install --upgrade pip && pip install -r requirements.txt

COPY . .

ENV PORT=7860
EXPOSE 7860

# Hugging Face Spaces expects the app to listen on 0.0.0.0:$PORT.
# gthread: long uploads must not block health/poll requests. timeout 0: a 1GB
# POST can take longer than gunicorn's default 30s silent-worker kill.
CMD ["sh", "-c", "gunicorn -w 1 -k gthread --threads 8 --timeout 0 -b 0.0.0.0:${PORT} app.main:app"]