# TrendClip Video Composer Server # FastAPI server for scene selection and video composition FROM python:3.11-slim # Set working directory WORKDIR /app/composer # Install system dependencies RUN apt-get update && apt-get install -y \ build-essential \ python3-dev \ ffmpeg \ libsm6 \ libxext6 \ libxrender-dev \ && rm -rf /var/lib/apt/lists/* # Copy requirements COPY requirements_server.txt . # Install Python dependencies with numpy fix RUN pip install --upgrade pip setuptools wheel RUN pip install --no-cache-dir --upgrade numpy==2.0.0 RUN pip install --no-cache-dir -r requirements_server.txt # Copy application files COPY server.py . COPY composer_v2.py . # Copy assets (fonts, etc.) COPY asset/ asset/ # Copy static files (UI) COPY static/ static/ # Create necessary directories RUN mkdir -p selected candidates renders upload_candidates # Expose port EXPOSE 7860 # Environment variables ENV PYTHONUNBUFFERED=1 ENV PYTHONIOENCODING=utf-8 # Run server with uvicorn CMD ["uvicorn", "server:app", "--host", "0.0.0.0", "--port", "7860"]