| |
| FROM python:3.10-slim |
|
|
| |
| RUN apt-get update && apt-get install -y \ |
| build-essential \ |
| gcc \ |
| g++ \ |
| && rm -rf /var/lib/apt/lists/* |
|
|
| |
| RUN useradd -m -u 1000 user |
| USER user |
| ENV HOME=/home/user \ |
| PATH=/home/user/.local/bin:$PATH |
| WORKDIR $HOME/app |
|
|
| |
| COPY --chown=user requirements.txt . |
|
|
| |
| RUN pip install --no-cache-dir llama-cpp-python --extra-index-url https://abetlen.github.io/llama-cpp-python/whl/cpu |
|
|
| |
| RUN pip install --no-cache-dir --prefer-binary -r requirements.txt |
|
|
| |
| COPY --chown=user . . |
|
|
| |
| EXPOSE 7860 |
| CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"] |