# Read the doc: https://huggingface.co/docs/hub/spaces-sdks-docker # NCAkit - Neural Content Automation Toolkit FROM python:3.9 # Install system dependencies (ffmpeg, imagemagick, fonts for video processing) RUN apt-get update && apt-get install -y --no-install-recommends \ ffmpeg \ libsndfile1 \ imagemagick \ fonts-liberation \ fonts-dejavu-core \ && rm -rf /var/lib/apt/lists/* # Fix ImageMagick policy to allow text rendering # Use find to locate policy.xml as the path varies by version RUN find /etc -name "policy.xml" -exec sed -i 's/none/read,write/g' {} + RUN useradd -m -u 1000 user USER user ENV PATH="/home/user/.local/bin:$PATH" WORKDIR /app COPY --chown=user ./requirements.txt requirements.txt RUN pip install --no-cache-dir --upgrade -r requirements.txt COPY --chown=user . /app CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "8880"]