Merge pull request #1 from zhangpeihaoks/feat-docker

feat: add support for docker deploy
This commit is contained in:
zhangpeihaoks 2024-12-03 12:14:42 +08:00 committed by GitHub
commit de20f65a35
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 57 additions and 1 deletions

27
.dockerignore Normal file
View File

@ -0,0 +1,27 @@
__pycache__/
*.py[cod]
/output/
/input/
!/input/example.png
/models/
/temp/
/custom_nodes/
!custom_nodes/example_node.py.example
extra_model_paths.yaml
/.vs
.vscode/
.idea/
venv/
.venv/
/web/extensions/*
!/web/extensions/logging.js.example
!/web/extensions/core/
/tests-ui/data/object_info.json
/user/
*.log
web_custom_versions/
.DS_Store
Dockerfile
docker-compose.yml
*.whl

17
Dockerfile Normal file
View File

@ -0,0 +1,17 @@
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 && \
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
COPY . .
CMD ["python3", "main.py"]

12
docker-compose.yaml Normal file
View File

@ -0,0 +1,12 @@
services:
comfyui:
build: .
ports:
- "8188:8188"
deploy:
resources:
reservations:
devices:
- driver: "nvidia"
count: "all"
capabilities: ["gpu"]

View File

@ -1,4 +1,4 @@
torch
torch==2.3.1
torchsde
torchvision
torchaudio