Spaces:
Build error
Build error
| FROM python:3.10-slim | |
| # 1. Setup User (Required for Spaces) | |
| RUN useradd -m -u 1000 user | |
| USER user | |
| ENV HOME=/home/user \ | |
| PATH=/home/user/.local/bin:$PATH | |
| WORKDIR $HOME/app | |
| # 2. Install Basic Tools (Keep these just in case) | |
| USER root | |
| RUN apt-get update && apt-get install -y \ | |
| git \ | |
| && rm -rf /var/lib/apt/lists/* | |
| USER user | |
| # 3. SMART INSTALL: Use Pre-Built Wheels! | |
| # We copy requirements but use a special URL to fetch the pre-compiled engine | |
| COPY --chown=user requirements.txt requirements.txt | |
| RUN pip install --no-cache-dir --upgrade pip && \ | |
| pip install --no-cache-dir -r requirements.txt --extra-index-url https://abetlen.github.io/llama-cpp-python/whl/cpu | |
| # 4. Copy Application | |
| COPY --chown=user . . | |
| # 5. Launch | |
| CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"] |