# Using a robust Ubuntu-based Python environment FROM python:3.10-bullseye # Set working directory WORKDIR /app # 1. Install ESSENTIAL build tools and common libraries # This ensures every standard C library is available RUN apt-get update && apt-get install -y \ build-essential \ python3-dev \ libgl1 \ libglib2.0-0 \ && rm -rf /var/lib/apt/lists/* # 2. Prevent the system from ever looking for 'musl' ENV PIP_NO_CACHE_DIR=1 ENV PIP_PREFER_BINARY=1 # 3. Step-by-Step Stable Install RUN pip install --upgrade pip RUN pip install numpy==1.26.4 RUN pip install cryptography==42.0.5 RUN pip install huggingface_hub==0.23.0 RUN pip install gradio==4.44.0 fastapi uvicorn # 4. FORCE INSTALL the CPU-only Glibc-compatible wheel # We are using a specific older stable version known to work on Debian Bullseye RUN pip install llama-cpp-python==0.2.76 --extra-index-url https://abetlen.github.io/llama-cpp-python/whl/cpu # 5. Finalize COPY . . EXPOSE 7860 ENV GRADIO_SERVER_NAME="0.0.0.0" CMD ["python", "app.py"]