From 027d9287d46b7b0b1ffd41e46b8e1881ee3bebc8 Mon Sep 17 00:00:00 2001 From: Kris Lamoureux Date: Tue, 14 Jul 2026 23:30:28 -0400 Subject: [PATCH] Add containerized ComfyUI deployment --- .gitignore | 2 ++ Dockerfile | 11 +++++++++++ docker-compose.yml | 18 ++++++++++++++++++ 3 files changed, 31 insertions(+) create mode 100644 .gitignore create mode 100644 Dockerfile create mode 100644 docker-compose.yml diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..6c5156b --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +data +.env diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..dcac4e3 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,11 @@ +FROM docker.io/pytorch/pytorch:2.6.0-cuda12.4-cudnn9-runtime +ARG COMFYUI_VERSION=v0.27.1 +RUN apt-get update && apt-get install -y --no-install-recommends \ + build-essential git \ + && rm -rf /var/lib/apt/lists/* +RUN git clone --depth 1 --branch ${COMFYUI_VERSION} \ + https://github.com/comfyanonymous/ComfyUI /app +WORKDIR /app +RUN pip install --no-cache-dir -r requirements.txt +EXPOSE 8188 +CMD ["python", "main.py", "--listen", "0.0.0.0"] diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..359ccaf --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,18 @@ +services: + comfyui: + build: + context: . + image: localhost/comfyui:latest + restart: unless-stopped + container_name: comfyui + ports: + - "${ENDPOINT:?}:8188" + volumes: + - ./data/models:/app/models + - ./data/input:/app/input + - ./data/output:/app/output + - ./data/user:/app/user + - ./data/custom_nodes:/app/custom_nodes + - ./data/triton-cache:/root/.triton + devices: + - nvidia.com/gpu=all