confyui / Dockerfile
fengmiguoji's picture
Update Dockerfile
2f6cdee verified
raw
history blame contribute delete
987 Bytes
# 使用官方 Python 镜像作为基础镜像
FROM python:3.10-slim
# 设置工作目录
WORKDIR /app
# 安装必要的 Python 依赖
RUN pip install --no-cache-dir torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cpu
# 安装ComfyUI 依赖 (使用 requirements.txt)
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
# 设置环境变量
ENV PATH="/app/ComfyUI:$PATH"
# 直接使用 wwwzhouhui569/comfyui_bizyair:v0.4.0 镜像作为基础
FROM wwwzhouhui569/comfyui_bizyair:v0.4.0
# 复制并设置工作目录
WORKDIR /app
# 设置 bizyair 的缓存目录
ENV BIZYAIR_CACHE_DIR="/tmp/.bizyair_cache"
# 设置 TRANSFORMERS 的缓存目录
ENV TRANSFORMERS_CACHE="/tmp/.huggingface_cache"
# 定义端口
EXPOSE 8188
# 预先创建缓存目录并赋予权限
RUN mkdir -p /tmp/.bizyair_cache && chmod -R 777 /tmp/.bizyair_cache
# 修改启动命令为使用 CPU
CMD ["python", "main.py", "--listen", "--port", "8188", "--cpu"]