FROM python:3.11-slim # Install system dependencies RUN apt-get update && apt-get install -y curl zstd && rm -rf /var/lib/apt/lists/* # Install Ollama RUN curl -fsSL https://ollama.com/install.sh | sh # Set working directory WORKDIR /app # Copy requirements and install COPY requirements.txt . RUN pip install --no-cache-dir -r requirements.txt # Copy application code COPY main.py . # Expose port 7860 (HF Space default) EXPOSE 7860 # Script to start Ollama and then the FastAPI app RUN echo '#!/bin/bash\nollama serve & sleep 5 && ollama pull aiasistentworld/Kimi-VL-A3B-Thinking-2506-LLM:latest && python main.py' > start.sh RUN chmod +x start.sh CMD ["./start.sh"]