| FROM python:3.10-slim |
|
|
| |
| RUN apt-get update && apt-get install -y \ |
| libopenblas-dev \ |
| libgomp1 \ |
| curl \ |
| && rm -rf /var/lib/apt/lists/* |
|
|
| WORKDIR /app |
|
|
| |
| RUN pip install --no-cache-dir fastapi uvicorn huggingface_hub pydantic |
|
|
| |
| RUN pip install https://huggingface.co/Luigi/llama-cpp-python-wheels-hf-spaces-free-cpu/resolve/main/llama_cpp_python-0.3.22-cp310-cp310-linux_x86_64.whl |
|
|
| |
| RUN useradd -m -u 1000 user |
| USER user |
|
|
| |
| COPY --chown=user app.py . |
|
|
| |
| EXPOSE 7860 |
|
|
| |
| CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"] |