full.Dockerfile 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. ARG UBUNTU_VERSION=22.04
  2. FROM ubuntu:$UBUNTU_VERSION AS build
  3. RUN apt-get update && \
  4. apt-get install -y build-essential git cmake libcurl4-openssl-dev
  5. WORKDIR /app
  6. COPY . .
  7. RUN cmake -S . -B build -DGGML_BACKEND_DL=ON -DGGML_NATIVE=OFF -DGGML_CPU_ALL_VARIANTS=ON -DLLAMA_CURL=ON -DCMAKE_BUILD_TYPE=Release && \
  8. cmake --build build -j $(nproc) && \
  9. mkdir -p /app/lib && \
  10. find build -name "*.so" -exec cp {} /app/lib/ \;
  11. FROM ubuntu:$UBUNTU_VERSION as runtime
  12. WORKDIR /app
  13. RUN apt-get update && \
  14. apt-get install -y build-essential python3 python3-pip git libcurl4-openssl-dev libgomp1
  15. COPY requirements.txt /app/requirements.txt
  16. COPY requirements /app/requirements
  17. COPY .devops/tools.sh /app/tools.sh
  18. RUN pip install --upgrade pip setuptools wheel && \
  19. pip install -r /app/requirements.txt
  20. COPY --from=build /app/build/bin/ /app/
  21. COPY --from=build /app/lib/ /app/
  22. COPY --from=build /app/convert_hf_to_gguf.py /app/
  23. COPY --from=build /app/gguf-py /app/gguf-py
  24. ENV LC_ALL=C.utf8
  25. ENTRYPOINT ["/app/tools.sh"]