Update Dockerfile
Browse files- Dockerfile +5 -13
Dockerfile
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
FROM python:3.10-slim
|
| 2 |
|
| 3 |
-
#
|
| 4 |
RUN apt-get update && apt-get install -y \
|
| 5 |
libopenblas-dev \
|
| 6 |
curl \
|
|
@@ -8,21 +8,13 @@ RUN apt-get update && apt-get install -y \
|
|
| 8 |
|
| 9 |
WORKDIR /app
|
| 10 |
|
| 11 |
-
#
|
| 12 |
RUN pip install --no-cache-dir fastapi uvicorn huggingface_hub pydantic
|
| 13 |
|
| 14 |
-
#
|
| 15 |
-
|
| 16 |
-
RUN pip install llama-cpp-python \
|
| 17 |
-
--extra-index-url https://abetlen.github.io/llama-cpp-python/whl/cpu
|
| 18 |
-
|
| 19 |
-
# Если выше не сработает — попробуй конкретный wheel (более стабильный вариант):
|
| 20 |
-
# RUN pip install https://github.com/abetlen/llama-cpp-python/releases/download/v0.3.19/llama_cpp_python-0.3.19-cp310-cp310-linux_x86_64.whl
|
| 21 |
-
|
| 22 |
-
# Или ещё один проверенный способ:
|
| 23 |
-
# RUN CMAKE_ARGS="-DLLAMA_BLAS=ON -DLLAMA_BLAS_VENDOR=OpenBLAS" \
|
| 24 |
-
# pip install llama-cpp-python --no-cache-dir --force-reinstall --no-binary llama-cpp-python
|
| 25 |
|
|
|
|
| 26 |
RUN useradd -m -u 1000 user
|
| 27 |
USER user
|
| 28 |
|
|
|
|
| 1 |
FROM python:3.10-slim
|
| 2 |
|
| 3 |
+
# Устанавливаем только самое необходимое
|
| 4 |
RUN apt-get update && apt-get install -y \
|
| 5 |
libopenblas-dev \
|
| 6 |
curl \
|
|
|
|
| 8 |
|
| 9 |
WORKDIR /app
|
| 10 |
|
| 11 |
+
# Основные пакеты
|
| 12 |
RUN pip install --no-cache-dir fastapi uvicorn huggingface_hub pydantic
|
| 13 |
|
| 14 |
+
# 🔥 Самый быстрый способ — готовый pre-built wheel (не собирается из исходников)
|
| 15 |
+
RUN pip install https://github.com/abetlen/llama-cpp-python/releases/download/v0.3.19/llama_cpp_python-0.3.19-cp310-cp310-linux_x86_64.whl
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 16 |
|
| 17 |
+
# Создаём непривилегированного пользователя
|
| 18 |
RUN useradd -m -u 1000 user
|
| 19 |
USER user
|
| 20 |
|