File size: 1,874 Bytes
132f09c b490bff 132f09c b490bff 132f09c 8c4d4e3 132f09c 8c4d4e3 | 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 35 36 37 38 39 40 41 42 43 44 45 46 47 | # ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
# Jigarzzzβ€οΈ β Hugging Face Spaces Dockerfile [v2 - 2026-06-22]
# Python 3.11 slim + FFmpeg + all deps + pytubefix + tor proxy
# ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
FROM python:3.11-slim
# Install system deps: FFmpeg + ImageMagick (for moviepy text clips) + fonts + tor
RUN apt-get update && apt-get install -y --no-install-recommends \
ffmpeg \
imagemagick \
libmagic1 \
fonts-dejavu-core \
fonts-liberation \
curl \
nodejs \
&& rm -rf /var/lib/apt/lists/*
# ImageMagick policy fix β allow reading/writing all file types (needed by moviepy)
RUN sed -i 's/rights="none" pattern="PDF"/rights="read|write" pattern="PDF"/' /etc/ImageMagick-6/policy.xml 2>/dev/null || true && \
sed -i 's/<policy domain="path" rights="none" pattern="@\*"\/>//' /etc/ImageMagick-6/policy.xml 2>/dev/null || true
# Set working directory
WORKDIR /app
# Copy and install Python dependencies first (for layer caching)
COPY requirements.txt .
RUN pip install --no-cache-dir --upgrade pip && \
pip install --no-cache-dir -r requirements.txt && \
pip install --no-cache-dir gunicorn Pillow requests
# Copy application source
COPY . .
# Create writable directories for uploads and outputs
RUN mkdir -p uploads outputs && chmod 777 uploads outputs
# Hugging Face Spaces requires the app to listen on port 7860
ENV PORT=7860
ENV HOST=0.0.0.0
# Expose port
EXPOSE 7860
# Run startup script that configures and starts Tor and Gunicorn
RUN chmod +x start.sh
CMD ["/app/start.sh"]
|