File size: 890 Bytes
50f8981 b0a95c7 50f8981 38de7ab 5c919ff 50f8981 b0a95c7 50f8981 180bb8d 50f8981 4db9045 50f8981 4db9045 50f8981 9889f52 00e173b 769e541 c68ef0b 00e173b 50f8981 4db9045 50f8981 5c919ff db1556d b0a95c7 50f8981 c68ef0b | 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 | FROM python:3.11-slim
# System dependencies
RUN apt-get update && apt-get install -y --no-install-recommends \
ffmpeg git \
&& rm -rf /var/lib/apt/lists/*
# Setup user for Hugging Face (UID 1000)
RUN useradd -m -u 1000 user
USER user
ENV PATH="/home/user/.local/bin:$PATH"
ENV HF_HOME="/home/user/.cache/huggingface"
WORKDIR /home/user/app
# Install dependencies
RUN pip install --no-cache-dir --upgrade pip && \
pip install --no-cache-dir --extra-index-url https://download.pytorch.org/whl/cpu \
torch==2.6.0+cpu \
transformers>=4.49.0 \
accelerate>=1.3.0 \
flask==3.1.1 \
gunicorn \
huggingface_hub>=0.27.0 \
edge-tts
# Copy files and create image directory
COPY --chown=user:user . .
RUN mkdir -p /home/user/app/img
EXPOSE 7860
# Start with Gunicorn for better stability
CMD ["gunicorn", "-b", "0.0.0.0:7860", "app:app", "--timeout", "120"] |