Yermek68 commited on
Commit
9dae6fe
·
verified ·
1 Parent(s): e7f482b

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +10 -9
Dockerfile CHANGED
@@ -1,23 +1,24 @@
1
- # 1️⃣ Используем чистый официальный Python образ
2
  FROM python:3.10-slim
3
 
4
- # 2️⃣ Устанавливаем системные зависимости
5
  RUN apt-get update && apt-get install -y git ffmpeg libsm6 libxext6 && rm -rf /var/lib/apt/lists/*
6
 
7
  # 3️⃣ Рабочая директория
8
  WORKDIR /app
9
  COPY . /app
10
 
11
- # 4️⃣ Устанавливаем зависимости и устраняем конфликт huggingface-hub
12
- RUN pip install --no-cache-dir --upgrade pip \
13
  && pip uninstall -y gradio gradio-client spaces huggingface-hub || true \
14
  && pip install --no-cache-dir -r requirements.txt \
15
- && pip install --force-reinstall --no-cache-dir "huggingface-hub==0.23.4" "transformers==4.46.0" "torch==2.4.1" \
 
16
  && pip check
17
 
18
- # 5️⃣ Проверка версии
19
- RUN python -c "import huggingface_hub; print('✅ huggingface-hub version:', huggingface_hub.__version__)"
 
 
20
 
21
- EXPOSE 7860
22
- CMD ["python", "app.py"]
23
 
 
1
+ # 1️⃣ Базовый образ
2
  FROM python:3.10-slim
3
 
4
+ # 2️⃣ Системные зависимости
5
  RUN apt-get update && apt-get install -y git ffmpeg libsm6 libxext6 && rm -rf /var/lib/apt/lists/*
6
 
7
  # 3️⃣ Рабочая директория
8
  WORKDIR /app
9
  COPY . /app
10
 
11
+ # 4️⃣ Установка Python-зависимостей
12
+ RUN pip install --upgrade pip \
13
  && pip uninstall -y gradio gradio-client spaces huggingface-hub || true \
14
  && pip install --no-cache-dir -r requirements.txt \
15
+ && pip install --no-cache-dir "transformers==4.46.0" "torch==2.4.1" \
16
+ && pip install --force-reinstall --no-cache-dir "huggingface-hub==0.23.4" \
17
  && pip check
18
 
19
+ # 5️⃣ Добавляем runtime-фикс — переустановка перед запуском
20
+ CMD bash -c "\
21
+ pip install --force-reinstall --no-cache-dir 'huggingface-hub==0.23.4' && \
22
+ python app.py"
23
 
 
 
24