File size: 887 Bytes
50f8981 b0a95c7 7807835 38de7ab 5c919ff 50f8981 b0a95c7 7807835 50f8981 180bb8d 50f8981 4db9045 50f8981 4db9045 7807835 9889f52 00e173b 769e541 00e173b 50f8981 4db9045 7807835 50f8981 7807835 50f8981 5c919ff db1556d b0a95c7 7807835 | 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 deps
RUN apt-get update && apt-get install -y --no-install-recommends \
ffmpeg git \
&& rm -rf /var/lib/apt/lists/*
# HF Spaces requires 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 Python deps — CPU-only torch to save memory
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 \
huggingface_hub>=0.27.0 \
edge-tts
# Copy project files (includes app.py and img/ folder)
COPY --chown=user:user . .
# Make sure img dir exists even if empty (default.png must be inside)
RUN mkdir -p /home/user/app/img
EXPOSE 7860
CMD ["python", "app.py"] |