FROM python:3.9 # 1. Install zstd (Required to unpack Ollama) RUN apt-get update && apt-get install -y zstd && rm -rf /var/lib/apt/lists/* # 2. Install Ollama RUN curl -fsSL https://ollama.com/install.sh | sh # 3. Set up the working directory WORKDIR /code # 4. Install Python dependencies COPY ./requirements.txt /code/requirements.txt RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt # 5. Copy your files (including the .gguf and Modelfile) COPY . . # 6. Start the app CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]