FROM python:3.11-slim WORKDIR /app # 1. Install System Tools & Curl RUN apt-get update && apt-get install -y \ build-essential \ curl \ && rm -rf /var/lib/apt/lists/* # 2. Install Ollama (The actual software) RUN curl -fsSL https://ollama.com/install.sh | sh # 3. Install Python Deps COPY requirements.txt . RUN pip install --no-cache-dir -r requirements.txt # 4. Copy Code COPY . . # 5. Start Ollama in background, Pull Model, then Run Streamlit # We use a wrapper script to ensure Ollama starts before the app CMD ollama serve & \ sleep 5 && \ ollama pull llama3.2:3b && \ ollama pull hf.co/CompendiumLabs/bge-base-en-v1.5-gguf && \ streamlit run app.py --server.port 7860 --server.address 0.0.0.0