| FROM python:3.10-slim |
|
|
| RUN apt-get update && apt-get install -y --no-install-recommends \ |
| build-essential \ |
| libopenblas-dev \ |
| pkg-config \ |
| git \ |
| && rm -rf /var/lib/apt/lists/* |
|
|
| RUN useradd -m -u 1000 user |
| USER user |
| ENV PATH="/home/user/.local/bin:$PATH" |
| ENV HF_HUB_CACHE="/tmp/hf_cache" |
| WORKDIR /app |
|
|
| COPY --chown=user requirements.txt . |
| RUN CMAKE_ARGS="-DLLAMA_BLAS=ON -DLLAMA_BLAS_VENDOR=OpenBLAS -DLLAMA_NATIVE=OFF" \ |
| pip install --no-cache-dir --upgrade -r requirements.txt |
|
|
| COPY --chown=user . . |
| CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"] |