feat: update Dockerfile

This commit is contained in:
zhangpeihao 2024-12-03 16:25:57 +08:00
parent ef174de5b0
commit 70886e1d92

View File

@ -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"]
# 执行主程序
CMD ["python3", "main.py"]