FROM python:3.11-slim # Install Node.js (for promptfoo) and system tools RUN apt-get update && apt-get install -y \ curl \ git \ nodejs \ npm \ && rm -rf /var/lib/apt/lists/* # Install promptfoo globally RUN npm install -g promptfoo WORKDIR /app # --- ULTIMATE FIX: Force Specific Platform --- RUN pip download --only-binary :all: \ --platform manylinux_2_17_x86_64 \ --python-version 311 \ --implementation cp \ --abi cp311 \ "llama-cpp-python" \ --extra-index-url "https://abetlen.github.io/llama-cpp-python/whl/cpu" \ -d /tmp/wheels RUN pip install --no-cache-dir /tmp/wheels/llama*.whl && rm -rf /tmp/wheels # --- Install Standard Requirements --- COPY requirements.txt . RUN pip install --no-cache-dir -r requirements.txt # Copy application code COPY . . EXPOSE 7860 CMD ["uvicorn", "server:app", "--host", "0.0.0.0", "--port", "7860"]