diff --git a/Dockerfile b/Dockerfile index 07b204f8c..c4f41c041 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,17 +1,28 @@ FROM python:3.12-slim + WORKDIR /app + ENV DEBIAN_FRONTEND=noninteractive \ PIP_NO_CACHE_DIR=on -RUN --mount=type=cache,target=/var/cache/apt \ - apt-get update && \ - apt-get install git -y && \ + +# 安装必要的软件包 +RUN apt-get update && \ + apt-get install -y git && \ apt-get clean && \ rm -rf /var/lib/apt/lists/* -COPY requirements.txt requirements.txt -RUN pip install torch==2.3.1 torchvision==0.18.1 torchaudio --extra-index-url https://download.pytorch.org/whl/cu124 \ - && pip install -r requirements.txt +# 克隆自定义节点 +RUN git clone https://github.com/ltdrdata/ComfyUI-Manager.git /app/custom_nodes/ComfyUI-Manager +# 安装依赖 +COPY requirements.txt requirements.txt +RUN pip install torch==2.3.1 torchvision==0.18.1 torchaudio --extra-index-url https://download.pytorch.org/whl/cu124 + +# 寻找所有目录下的requirements.txt文件并安装 +RUN find . -name requirements.txt -exec pip install -r {} \; + +# 拷贝当前目录下的所有文件到工作目录 COPY . . -CMD ["python3", "main.py"] \ No newline at end of file +# 执行主程序 +CMD ["python3", "main.py"]