Spaces:
Sleeping
Sleeping
Update Dockerfile
Browse files- Dockerfile +10 -9
Dockerfile
CHANGED
|
@@ -1,23 +1,24 @@
|
|
| 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️⃣
|
| 12 |
-
RUN pip install --
|
| 13 |
&& pip uninstall -y gradio gradio-client spaces huggingface-hub || true \
|
| 14 |
&& pip install --no-cache-dir -r requirements.txt \
|
| 15 |
-
&& pip install --
|
|
|
|
| 16 |
&& pip check
|
| 17 |
|
| 18 |
-
# 5️⃣
|
| 19 |
-
|
|
|
|
|
|
|
| 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 |
|