mirror of
https://github.com/comfyanonymous/ComfyUI.git
synced 2025-04-19 19:03:51 +00:00
Merge d4df3d919f
into 22ad513c72
This commit is contained in:
commit
9d6fce7445
12
Dockerfile
Normal file
12
Dockerfile
Normal file
@ -0,0 +1,12 @@
|
||||
# 替换为自己的python镜像地址
|
||||
FROM registry.cn-hangzhou.aliyuncs.com/wxa/python:3.12
|
||||
# 设置工作目录
|
||||
WORKDIR /app
|
||||
# 复制 requirements.txt 和安装依赖
|
||||
COPY requirements.txt /app/requirements.txt
|
||||
# 安装依赖,指定阿里镜像源
|
||||
RUN pip install --no-cache-dir -i https://mirrors.aliyun.com/pypi/simple/ -r /app/requirements.txt
|
||||
# 复制源代码到容器内
|
||||
COPY . /app
|
||||
# 设置容器的默认命令
|
||||
CMD ["python", "main.py"]
|
42
comfyui.yaml
Normal file
42
comfyui.yaml
Normal file
@ -0,0 +1,42 @@
|
||||
# 配置docker配置文件启用gpu
|
||||
#{
|
||||
# "runtimes": {
|
||||
# "nvidia": {
|
||||
# "args": [],
|
||||
# "path": "nvidia-container-runtime"
|
||||
# }
|
||||
# }
|
||||
#}
|
||||
# 打包启动镜像命令:docker compose build up -d
|
||||
|
||||
version: '1'
|
||||
|
||||
services:
|
||||
app:
|
||||
build: .
|
||||
container_name: comfyui
|
||||
runtime: nvidia
|
||||
deploy:
|
||||
resources:
|
||||
reservations:
|
||||
devices:
|
||||
- driver: nvidia
|
||||
count: all
|
||||
capabilities: [ gpu ]
|
||||
|
||||
volumes:
|
||||
- .:/app
|
||||
- ./app/models/Stable-diffusion:/app/models/Stable-diffusion # 绑定模型目录
|
||||
ports:
|
||||
- "8188:8188" # 如果你的应用需要暴露端口
|
||||
command: python main.py # 启动 main.py 文件
|
||||
environment:
|
||||
- PYTHONUNBUFFERED=1 # 确保输出不会被缓冲
|
||||
working_dir: /app
|
||||
restart: always
|
||||
|
||||
networks:
|
||||
- my_custom_network
|
||||
networks:
|
||||
my_custom_network:
|
||||
name: comfyui
|
Loading…
Reference in New Issue
Block a user