File size: 1,657 Bytes
b32806b
 
761daf8
b32806b
29c41c1
b32806b
 
 
 
2d94f6c
761daf8
 
 
 
 
 
 
b32806b
 
761daf8
 
b32806b
761daf8
b32806b
 
761daf8
2d94f6c
 
 
9c7a37f
b32806b
2d94f6c
b32806b
2d94f6c
b32806b
2d94f6c
 
 
b32806b
2d94f6c
 
b32806b
 
761daf8
2d94f6c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
FROM nvidia/cuda:12.1.0-runtime-ubuntu22.04

# 安装基础依赖和 Miniconda(来自 conda-forge 的 deb 包)
RUN apt-get update && apt-get install -y \
    build-essential \
    git \
    wget \
    ffmpeg \
    libsndfile1 \
    bzip2 \
    curl \
    ca-certificates \
    software-properties-common \
    && curl -fsSL https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -o /tmp/miniconda.sh \
    && bash /tmp/miniconda.sh -b -p /opt/conda \
    && rm /tmp/miniconda.sh \
    && apt-get clean \
    && rm -rf /var/lib/apt/lists/*

# 添加 conda 到 PATH
ENV PATH="/opt/conda/bin:$PATH"

# 创建 conda 虚拟环境
RUN conda create -n mimictalk python=3.9 -y

# 安装 Python 依赖(用 conda run)
RUN conda run -n mimictalk pip install torch==2.4.0 torchvision==0.19.0 torchaudio==2.4.0 --index-url https://download.pytorch.org/whl/cu121
RUN conda run -n mimictalk pip install cython openmim==0.3.9
RUN conda run -n mimictalk mim install mmcv==2.1.0
# RUN conda run -n mimictalk pip install "git+https://github.com/facebookresearch/pytorch3d.git@stable"

# 安装项目依赖
COPY requirements.txt /tmp/
RUN conda run -n mimictalk pip install -r /tmp/requirements.txt

# 下载模型文件
RUN conda run -n mimictalk pip install huggingface_hub && \
    conda run -n mimictalk python -c "from huggingface_hub import snapshot_download; snapshot_download('mrbear1024/demo-model', local_dir='/app/models')"

# 拷贝项目代码
COPY . /app
WORKDIR /app

# 启动命令(通过 conda 运行 Python 脚本)
CMD ["/opt/conda/bin/conda", "run", "--no-capture-output", "-n", "mimictalk", "python", "inference/app_mimictalk.py"]