AnatoliiG commited on
Commit
c5f3f78
·
1 Parent(s): 90ce603

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +27 -7
Dockerfile CHANGED
@@ -1,10 +1,26 @@
1
- FROM python:3.10-slim-bookworm
2
 
3
- # Устанавливаем libgomp1 (необходим для работы многопоточности OpenMP в модели)
 
 
 
4
  RUN apt-get update && apt-get install -y --no-install-recommends \
 
 
 
 
5
  libgomp1 \
 
 
 
 
 
 
6
  && rm -rf /var/lib/apt/lists/*
7
 
 
 
 
8
  RUN useradd -m -u 1000 user
9
  USER user
10
  ENV HOME=/home/user \
@@ -13,16 +29,20 @@ ENV HOME=/home/user \
13
 
14
  WORKDIR /app
15
 
16
- RUN pip install --no-cache-dir --upgrade pip
 
17
 
18
- # УСТАНОВКА СОВМЕСТИМОГО БИНАРНИКА С ПОДДЕРЖКОЙ OPENBLAS НАПРЯМУЮ С HF (установка за 3 секунды)
19
- RUN pip install --no-cache-dir \
20
  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
21
 
 
22
  COPY --chown=user requirements.txt .
23
- RUN pip install --no-cache-dir -r requirements.txt
24
 
25
  COPY --chown=user . .
26
 
27
  EXPOSE 7860
28
- CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]
 
 
 
1
+ FROM ubuntu:24.04
2
 
3
+ # Отключаем интерактивные диалоги во время установки пакетов
4
+ ENV DEBIAN_FRONTEND=noninteractive
5
+
6
+ # Устанавливаем PPA deadsnakes и системные зависимости (включая glibc 2.39 и libgomp1)
7
  RUN apt-get update && apt-get install -y --no-install-recommends \
8
+ software-properties-common \
9
+ ca-certificates \
10
+ curl \
11
+ git \
12
  libgomp1 \
13
+ && add-apt-repository ppa:deadsnakes/ppa \
14
+ && apt-get update && apt-get install -y --no-install-recommends \
15
+ python3.10 \
16
+ python3.10-dev \
17
+ python3.10-distutils \
18
+ python3.10-venv \
19
  && rm -rf /var/lib/apt/lists/*
20
 
21
+ # Устанавливаем pip специально для Python 3.10
22
+ RUN curl -sS https://bootstrap.pypa.io/get-pip.py | python3.10
23
+
24
  RUN useradd -m -u 1000 user
25
  USER user
26
  ENV HOME=/home/user \
 
29
 
30
  WORKDIR /app
31
 
32
+ # Обновляем pip для Python 3.10
33
+ RUN python3.10 -m pip install --no-cache-dir --upgrade pip
34
 
35
+ # Установка готового wheel-файла от Luigi (теперь он без проблем найдет нужный GLIBC)
36
+ RUN python3.10 -m pip install --no-cache-dir \
37
  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
38
 
39
+ # Устанавливаем зависимости из вашего requirements.txt
40
  COPY --chown=user requirements.txt .
41
+ RUN python3.10 -m pip install --no-cache-dir -r requirements.txt
42
 
43
  COPY --chown=user . .
44
 
45
  EXPOSE 7860
46
+
47
+ # Запускаем uvicorn через Python 3.10
48
+ CMD ["python3.10", "-m", "uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]