# Use a slim Python 3.10 base image for CPU compatibility ARG BASE_IMAGE=python:3.10-slim FROM ${BASE_IMAGE} # Install system dependencies RUN apt-get update && apt-get install -y \ git \ ffmpeg \ libjpeg-dev \ libpng-dev \ && rm -rf /var/lib/apt/lists/* # Upgrade pip to the latest version RUN pip install --no-cache-dir --upgrade pip # Set working directory WORKDIR /app # Create cache directory and set permissions RUN mkdir -p /app/hf_cache && chmod -R 777 /app/hf_cache # Set Hugging Face cache directory ENV HF_HOME=/app/hf_cache # Clone Chain-of-Zoom repository into a temporary directory RUN git clone https://github.com/bryanswkim/Chain-of-Zoom.git /tmp/chain-of-zoom && \ mv /tmp/chain-of-zoom/* . && \ mv /tmp/chain-of-zoom/.* . 2>/dev/null || true && \ rm -rf /tmp/chain-of-zoom # Copy custom files (overwrites any conflicting files from the repository) COPY requirements.txt . COPY app.py . # Install Python dependencies RUN pip install --no-cache-dir -r requirements.txt # Set environment variable for Hugging Face token ENV HF_TOKEN="" EXPOSE 7860 # Command to run the Gradio app CMD ["python", "app.py"]