|
|
|
FROM nvidia/cuda:12.1.1-cudnn8-runtime-ubuntu20.04 |
|
|
|
|
|
RUN useradd -m -u 1000 user |
|
|
|
|
|
USER user |
|
|
|
|
|
ENV HOME=/home/user \ |
|
PATH=/home/user/.local/bin:$PATH |
|
|
|
|
|
WORKDIR /app |
|
|
|
|
|
RUN apt-get update && apt-get install -y python3 python3-pip |
|
|
|
|
|
RUN apt-get install -y cmake build-essential |
|
|
|
|
|
ENV FORCE_CMAKE=1 |
|
ENV CMAKE_ARGS="-DLLAMA_CUBLAS=on" |
|
RUN pip install llama-cpp-python --no-cache-dir |
|
|
|
|
|
COPY --chown=user ./requirements.txt requirements.txt |
|
RUN pip install --no-cache-dir --upgrade -r requirements.txt |
|
|
|
|
|
COPY --chown=user . /app |
|
|
|
|
|
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"] |
|
|