FROM python:3.11-slim # Install FFmpeg and fonts RUN apt-get update && \ apt-get install -y --no-install-recommends \ ffmpeg \ fonts-dejavu-core \ curl \ && rm -rf /var/lib/apt/lists/* WORKDIR /app # Copy requirements and install COPY requirements.txt . RUN pip install --no-cache-dir -r requirements.txt # Copy application COPY overlay_service.py . # Create recordings directory RUN mkdir -p /recordings # Create user but don't switch to it - need root for shared volume RUN useradd -m -s /bin/bash overlay && \ chown -R overlay:overlay /app /recordings # Running as root to access shared /tmp volume # USER overlay # Health check HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \ CMD python -c "import sys; sys.exit(0)" CMD ["python", "-u", "overlay_service.py"]