VideoTranslate / Dockerfile
sushilideaclan01's picture
Enhance video upload handling and error messaging. Updated Dockerfile to use gthread for improved performance with large uploads. Added progress tracking for video uploads in the frontend, with error handling for insufficient credits and file size limits. Improved error messages for failed segments and added a user-friendly upload progress indicator in the UI.
bc162b4
Raw History Blame Contribute Delete
724 Bytes
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"]