CI builds and pushes the comfyui-nvidia image to the Gitea container registry on every v* tag, mirroring the figment release workflow. Compose now references the registry image (with build context kept for local iteration) and the docs reflect the pull-by-default flow. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
111 lines
4.0 KiB
YAML
111 lines
4.0 KiB
YAML
# comfyui-nvidia — ComfyUI image-generation backend fronted by Open WebUI.
|
|
#
|
|
# Open WebUI provides the multi-user chat UI and a built-in image-generation
|
|
# panel that submits ComfyUI workflows directly. Two workflow templates ship in
|
|
# workflows/ — txt2img.json and img2img.json. Paste them (and the matching
|
|
# node-mapping JSON) into the Open WebUI admin panel under
|
|
# Settings -> Images. See SETUP.md.
|
|
#
|
|
# Single GPU, single host. Both services share the comfyui-net bridge so Open
|
|
# WebUI addresses ComfyUI by service name (http://comfyui:8188).
|
|
|
|
name: comfyui-nvidia
|
|
|
|
networks:
|
|
comfyui-net:
|
|
driver: bridge
|
|
|
|
volumes:
|
|
comfyui-models: # /opt/comfyui/models (checkpoints, vae, loras, ...)
|
|
comfyui-custom-nodes: # /opt/comfyui/custom_nodes
|
|
comfyui-input: # /opt/comfyui/input (uploaded source images)
|
|
comfyui-output: # /opt/comfyui/output (generated images)
|
|
comfyui-user: # /opt/comfyui/user (saved workflows, settings)
|
|
open-webui-data: # Open WebUI accounts, chats, settings
|
|
|
|
services:
|
|
comfyui:
|
|
# CI (.gitea/workflows/release.yml) builds and pushes this image on tag.
|
|
# `build:` is kept so `docker compose build` still works locally — useful
|
|
# when iterating on the Dockerfile without going through CI.
|
|
image: git.anomalous.dev/alphacentri/comfyui-nvidia:${COMFYUI_IMAGE_TAG:-latest}
|
|
pull_policy: always
|
|
build:
|
|
context: .
|
|
dockerfile: Dockerfile
|
|
container_name: comfyui
|
|
restart: unless-stopped
|
|
networks: [comfyui-net]
|
|
ports:
|
|
# Optional on the host — Open WebUI reaches comfyui:8188 over the bridge.
|
|
# Keep it published if you also want to use ComfyUI's native web UI at
|
|
# http://localhost:8188.
|
|
- "8188:8188"
|
|
volumes:
|
|
- comfyui-models:/opt/comfyui/models
|
|
- comfyui-custom-nodes:/opt/comfyui/custom_nodes
|
|
- comfyui-input:/opt/comfyui/input
|
|
- comfyui-output:/opt/comfyui/output
|
|
- comfyui-user:/opt/comfyui/user
|
|
deploy:
|
|
resources:
|
|
reservations:
|
|
devices:
|
|
- driver: nvidia
|
|
count: all
|
|
capabilities: [gpu]
|
|
healthcheck:
|
|
test: ["CMD", "curl", "-sf", "http://127.0.0.1:8188/system_stats"]
|
|
interval: 30s
|
|
timeout: 5s
|
|
retries: 5
|
|
start_period: 120s
|
|
|
|
open-webui:
|
|
image: ghcr.io/open-webui/open-webui:main
|
|
container_name: open-webui
|
|
restart: unless-stopped
|
|
networks: [comfyui-net]
|
|
ports:
|
|
- "3000:8080"
|
|
extra_hosts:
|
|
# So Open WebUI can reach an Ollama instance running on the VM host.
|
|
# Drop this if you don't run Ollama on the host.
|
|
- "host.docker.internal:host-gateway"
|
|
depends_on:
|
|
comfyui:
|
|
condition: service_started
|
|
environment:
|
|
WEBUI_AUTH: "true"
|
|
ENABLE_SIGNUP: "true"
|
|
DEFAULT_USER_ROLE: "pending"
|
|
|
|
# Public URL used for auth redirects and email-link generation. Set this
|
|
# to whatever your reverse proxy terminates.
|
|
WEBUI_URL: "${OPEN_WEBUI_URL:-http://localhost:3000}"
|
|
|
|
# Cookie-signing key. Stable across restarts (rotating it logs every
|
|
# user out). Generate once: openssl rand -hex 32
|
|
WEBUI_SECRET_KEY: "${OPEN_WEBUI_SECRET_KEY:-change-me-please}"
|
|
|
|
# Optional: Ollama on the VM host for chat. Comment out if unused.
|
|
OLLAMA_BASE_URL: "http://host.docker.internal:11434"
|
|
|
|
# Image generation via ComfyUI. The workflow JSON and node-mapping JSON
|
|
# are configured through the admin UI — see SETUP.md for the paste-in
|
|
# values. Only the engine selection and base URL are wired here so the
|
|
# admin panel comes up pre-pointed at the right backend.
|
|
ENABLE_IMAGE_GENERATION: "true"
|
|
IMAGE_GENERATION_ENGINE: "comfyui"
|
|
COMFYUI_BASE_URL: "http://comfyui:8188"
|
|
IMAGE_SIZE: "1024x1024"
|
|
IMAGE_STEPS: "20"
|
|
volumes:
|
|
- open-webui-data:/app/backend/data
|
|
healthcheck:
|
|
test: ["CMD", "curl", "-sf", "http://127.0.0.1:8080/health"]
|
|
interval: 30s
|
|
timeout: 5s
|
|
retries: 3
|
|
start_period: 60s
|