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 \ unzip \ 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-15-v7-animeace # Download fonts from Google Fonts GitHub repo + copy AnimeAce from repo RUN rm -rf /app/fonts && \ mkdir -p /app/fonts/AnimeAce /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 "=== Downloading Anime Ace ===" && \ curl -fSL -o /tmp/animeace.zip "https://www.1001fonts.com/download/anime-ace.zip" && \ unzip -o /tmp/animeace.zip -d /tmp/animeace && \ cp /tmp/animeace/animeace.ttf /app/fonts/AnimeAce/AnimeAce-Regular.ttf && \ cp /tmp/animeace/animeace_b.ttf /app/fonts/AnimeAce/AnimeAce-Bold.ttf && \ cp /tmp/animeace/animeace_i.ttf /app/fonts/AnimeAce/AnimeAce-Italic.ttf && \ rm -rf /tmp/animeace /tmp/animeace.zip && \ 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"]