# Use a slightly more compatible base image FROM python:3.10-slim # Prevent Python from writing .pyc files ENV PYTHONDONTWRITEBYTECODE=1 ENV PYTHONUNBUFFERED=1 # 🚀 Disable GPU build (CRITICAL FIX) ENV CMAKE_ARGS="-DLLAMA_CUBLAS=off" # Install only REQUIRED system dependencies RUN apt-get update && apt-get install -y \ gcc \ g++ \ make \ cmake \ libopenblas-dev \ libgomp1 \ && rm -rf /var/lib/apt/lists/* WORKDIR /code # Upgrade pip first (important for wheel resolution) RUN pip install --upgrade pip # Copy requirements COPY requirements.txt . # 🚀 Force binary install (KEY FIX) RUN pip install --no-cache-dir --prefer-binary -r requirements.txt # Copy app COPY . . # Hugging Face uses port 7860 EXPOSE 7860 # Start API CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]