From 093b55c473bb52a39a5deb0ea32fc612f90a8d74 Mon Sep 17 00:00:00 2001 From: michael Date: Mon, 22 Dec 2025 14:55:14 -0600 Subject: [PATCH] fix: add ffmpeg to API container for TTS audio conversion MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The Gemini TTS service uses pydub which requires ffmpeg to convert audio formats. Previously only the Worker container had ffmpeg. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 --- backend/Dockerfile | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/backend/Dockerfile b/backend/Dockerfile index 5309fba..fa0a052 100644 --- a/backend/Dockerfile +++ b/backend/Dockerfile @@ -3,7 +3,7 @@ # ============================================================================= # Stage 1: Builder - Install dependencies # Stage 2: Base - Common runtime for API and Worker -# Stage 3: API - FastAPI + Gunicorn (no ffmpeg) +# Stage 3: API - FastAPI + Gunicorn (with ffmpeg for TTS audio conversion) # Stage 4: Worker - Celery worker (with ffmpeg for video processing) # ============================================================================= @@ -75,6 +75,18 @@ USER app # ----------------------------------------------------------------------------- FROM base AS api +# Switch to root to install ffmpeg +USER root + +# Install ffmpeg for TTS audio conversion +RUN apt-get update && apt-get install -y --no-install-recommends \ + ffmpeg \ + && rm -rf /var/lib/apt/lists/* \ + && apt-get clean + +# Switch back to non-root user +USER app + # Set production environment variables ENV APP_ENV=prod