FROM python:3.11-slim RUN apt-get update && apt-get install -y ffmpeg fonts-dejavu-core fonts-liberation fonts-freefont-ttf curl espeak-ng libsndfile1 fontconfig && rm -rf /var/lib/apt/lists/* WORKDIR /app ENV HF_HOME=/tmp/hfcache TRANSFORMERS_CACHE=/tmp/hfcache TORCH_HOME=/tmp/torch XDG_CACHE_HOME=/tmp/xdg COPY requirements.txt . RUN pip install --no-cache-dir -r requirements.txt # Bundle bold condensed fonts used by the 4 templates. RUN mkdir -p /app/fonts && cd /app/fonts && \ curl -fsSL -o Anton.ttf "https://github.com/google/fonts/raw/main/ofl/anton/Anton-Regular.ttf" && \ curl -fsSL -o BebasNeue.ttf "https://github.com/google/fonts/raw/main/ofl/bebasneue/BebasNeue-Regular.ttf" && \ curl -fsSL -o ArchivoBlack.ttf "https://github.com/google/fonts/raw/main/ofl/archivoblack/ArchivoBlack-Regular.ttf" && \ curl -fsSL -o Inter-Bold.ttf "https://github.com/google/fonts/raw/main/ofl/inter/Inter%5Bopsz%2Cwght%5D.ttf" || true COPY app.py . COPY anim_templates.py . ENV PORT=7860 EXPOSE 7860 CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]