FROM python:3.11-slim # Install system dependencies for skia-python (Debian Trixie compatible) RUN apt-get update && apt-get install -y \ libegl1 \ libgl1 \ libglib2.0-0 \ libglvnd0 \ libglx0 \ libopengl0 \ libfontconfig1 \ libfreetype6 \ libx11-6 \ libxext6 \ libxrender1 \ git \ git-lfs \ curl \ file \ && rm -rf /var/lib/apt/lists/* # Set work directory WORKDIR /app # Install Python dependencies COPY requirements.txt . RUN pip install --no-cache-dir -r requirements.txt # Copy application files COPY . . # Cache bust: 2026-01-11-v6 # Download all fonts from Google Fonts GitHub repo RUN rm -rf /app/fonts && \ mkdir -p /app/fonts/Bangers /app/fonts/ComicNeue /app/fonts/PatrickHand && \ echo "=== Downloading Bangers ===" && \ curl -fSL -o /app/fonts/Bangers/Bangers-Regular.ttf "https://github.com/google/fonts/raw/main/ofl/bangers/Bangers-Regular.ttf" && \ echo "=== Downloading Comic Neue ===" && \ curl -fSL -o /app/fonts/ComicNeue/ComicNeue-Regular.ttf "https://github.com/google/fonts/raw/main/ofl/comicneue/ComicNeue-Regular.ttf" && \ curl -fSL -o /app/fonts/ComicNeue/ComicNeue-Bold.ttf "https://github.com/google/fonts/raw/main/ofl/comicneue/ComicNeue-Bold.ttf" && \ curl -fSL -o /app/fonts/ComicNeue/ComicNeue-Italic.ttf "https://github.com/google/fonts/raw/main/ofl/comicneue/ComicNeue-Italic.ttf" && \ curl -fSL -o /app/fonts/ComicNeue/ComicNeue-BoldItalic.ttf "https://github.com/google/fonts/raw/main/ofl/comicneue/ComicNeue-BoldItalic.ttf" && \ echo "=== Downloading Patrick Hand ===" && \ curl -fSL -o /app/fonts/PatrickHand/PatrickHand-Regular.ttf "https://github.com/google/fonts/raw/main/ofl/patrickhand/PatrickHand-Regular.ttf" && \ echo "=== Verifying all fonts ===" && \ file /app/fonts/*/*.ttf && \ ls -la /app/fonts/*/ # Create necessary directories RUN mkdir -p /app/models /app/output # Set environment variables ENV PYTHONUNBUFFERED=1 ENV GRADIO_SERVER_NAME=0.0.0.0 ENV GRADIO_SERVER_PORT=7860 # Expose port EXPOSE 7860 # Run the app CMD ["python", "app.py"]