demo / Dockerfile
mrbear1024's picture
fixbug dockerfile
2d94f6c
raw
history blame
1.45 kB
FROM nvidia/cuda:12.1.0-runtime-ubuntu22.04
# 基础依赖
RUN apt-get update && apt-get install -y \
git \
wget \
ffmpeg \
libsndfile1 \
python3-pip \
bzip2 \
&& rm -rf /var/lib/apt/lists/*
# 安装 Miniconda
RUN wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh \
&& bash miniconda.sh -b -p /opt/conda \
&& rm miniconda.sh
ENV PATH=/opt/conda/bin:$PATH
# 创建 conda 环境
RUN conda create -n mimictalk python=3.9 -y
# 显式使用 conda run 安装依赖(不设置 SHELL)
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
# 启动命令
CMD ["/opt/conda/bin/conda", "run", "--no-capture-output", "-n", "mimictalk", "python", "inference/app_mimictalk.py"]