Spaces:
Paused
Paused
Update Dockerfile
Browse files- Dockerfile +52 -55
Dockerfile
CHANGED
|
@@ -1,56 +1,53 @@
|
|
| 1 |
-
# 1. 使用与 README 要求一致的 PyTorch 版本
|
| 2 |
-
FROM pytorch/pytorch:2.4.1-cuda12.1-cudnn9-devel
|
| 3 |
-
|
| 4 |
-
# 设置非交互式安装
|
| 5 |
-
ENV DEBIAN_FRONTEND=noninteractive
|
| 6 |
-
|
| 7 |
-
# 2. 安装系统依赖
|
| 8 |
-
RUN apt-get update && apt-get install -y \
|
| 9 |
-
git \
|
| 10 |
-
git-lfs \
|
| 11 |
-
ffmpeg \
|
| 12 |
-
libgl1-mesa-glx \
|
| 13 |
-
libglib2.0-0 \
|
| 14 |
-
&& rm -rf /var/lib/apt/lists/*
|
| 15 |
-
|
| 16 |
-
# 设置工作目录
|
| 17 |
-
WORKDIR /app
|
| 18 |
-
|
| 19 |
-
# 3. 克隆
|
| 20 |
-
RUN git clone https://github.com/MeiGen-AI/InfiniteTalk.git
|
| 21 |
-
|
| 22 |
-
# 进入仓库目录
|
| 23 |
-
WORKDIR /app/InfiniteTalk
|
| 24 |
-
|
| 25 |
-
# 4. 安装 Python 依赖 (
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
RUN pip install
|
| 38 |
-
|
| 39 |
-
|
| 40 |
-
|
| 41 |
-
#
|
| 42 |
-
RUN
|
| 43 |
-
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
|
| 47 |
-
|
| 48 |
-
|
| 49 |
-
#
|
| 50 |
-
|
| 51 |
-
|
| 52 |
-
#
|
| 53 |
-
COPY --chown=user:user run.py /app/InfiniteTalk/run.py
|
| 54 |
-
|
| 55 |
-
# 8. 启动
|
| 56 |
CMD ["python", "run.py"]
|
|
|
|
| 1 |
+
# 1. 使用与 README 要求一致的 PyTorch 版本
|
| 2 |
+
FROM pytorch/pytorch:2.4.1-cuda12.1-cudnn9-devel
|
| 3 |
+
|
| 4 |
+
# 设置非交互式安装
|
| 5 |
+
ENV DEBIAN_FRONTEND=noninteractive
|
| 6 |
+
|
| 7 |
+
# 2. 安装系统依赖
|
| 8 |
+
RUN apt-get update && apt-get install -y \
|
| 9 |
+
git \
|
| 10 |
+
git-lfs \
|
| 11 |
+
ffmpeg \
|
| 12 |
+
libgl1-mesa-glx \
|
| 13 |
+
libglib2.0-0 \
|
| 14 |
+
&& rm -rf /var/lib/apt/lists/*
|
| 15 |
+
|
| 16 |
+
# 设置工作目录
|
| 17 |
+
WORKDIR /app
|
| 18 |
+
|
| 19 |
+
# 3. 克隆仓库
|
| 20 |
+
RUN git clone https://github.com/MeiGen-AI/InfiniteTalk.git
|
| 21 |
+
|
| 22 |
+
# 进入仓库目录
|
| 23 |
+
WORKDIR /app/InfiniteTalk
|
| 24 |
+
|
| 25 |
+
# 4. 安装 Python 依赖 (关键修改在这里!!!)
|
| 26 |
+
RUN pip install --no-cache-dir --upgrade pip
|
| 27 |
+
|
| 28 |
+
# 确保安装了编译工具 (ninja, packaging 等)
|
| 29 |
+
RUN pip install --no-cache-dir ninja packaging wheel setuptools
|
| 30 |
+
|
| 31 |
+
# 【核心修复】加上 --no-build-isolation
|
| 32 |
+
# 这样它就能找到镜像里自带的 torch 了
|
| 33 |
+
RUN pip install --no-cache-dir --no-build-isolation flash_attn==2.7.4.post1
|
| 34 |
+
|
| 35 |
+
# 继续安装其他依赖
|
| 36 |
+
RUN pip install -U xformers==0.0.28 --index-url https://download.pytorch.org/whl/cu121
|
| 37 |
+
RUN pip install --no-cache-dir misaki[en] psutil
|
| 38 |
+
RUN pip install --no-cache-dir -r requirements.txt
|
| 39 |
+
RUN pip install --no-cache-dir gradio huggingface_hub
|
| 40 |
+
|
| 41 |
+
# 5. 设置权限
|
| 42 |
+
RUN useradd -m -u 1000 user
|
| 43 |
+
RUN chown -R user:user /app
|
| 44 |
+
USER user
|
| 45 |
+
|
| 46 |
+
# 6. 环境变量
|
| 47 |
+
ENV GRADIO_SERVER_NAME="0.0.0.0"
|
| 48 |
+
|
| 49 |
+
# 7. 复制启动脚本 (确保你有 run.py)
|
| 50 |
+
COPY --chown=user:user run.py /app/InfiniteTalk/run.py
|
| 51 |
+
|
| 52 |
+
# 8. 启动
|
|
|
|
|
|
|
|
|
|
| 53 |
CMD ["python", "run.py"]
|