| FROM python:3.11-slim | |
| # Instalar compiladores y CMake (CRUCIAL) | |
| RUN apt-get update && apt-get install -y \ | |
| build-essential \ | |
| cmake \ | |
| && rm -rf /var/lib/apt/lists/* | |
| WORKDIR /app | |
| COPY requirements.txt . | |
| RUN pip install --no-cache-dir -r requirements.txt | |
| # Forzar build CPU de llama-cpp-python (después de instalar deps) | |
| RUN CMAKE_ARGS="-DLLAMA_CUBLAS=off -DLLAMA_BLAS=off -DLLAMA_METAL=off" \ | |
| FORCE_CMAKE=1 pip install llama-cpp-python --force-reinstall --no-cache-dir | |
| COPY . . | |
| CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"] |