# Docker Compose file to run ComfyUI locally using Docker. services: comfyui: container_name: comfyui build: context: . args: # Declare additional system dependencies for custom nodes APT_EXTRA_PACKAGES: ports: - 8188:8188 # Optional: enable GPU access for hardware acceleration. deploy: resources: reservations: devices: - capabilities: [gpu] volumes: - ./custom_nodes:/comfyui/custom_nodes - ./models:/comfyui/models # (Optional) Mount host ComfyUI data directories # #- ./input:/comfyui/input #- ./output:/comfyui/output #- ./temp:/comfyui/temp #- ./user:/comfyui/user environment: # Overwrite the container user's UID and GID to match the host's. This # allows files created by ComfyUI to be mounted on the host without # permission issues. UID: 1000 GID: 1000 # Declare additional Python packages to install. Useful when a custom node # pack does not properly specify all its dependencies or relies on # optional dependencies. PIP_EXTRA_PACKAGES: # Optional: Override the default command. In this case, configure ComfyUI to # listen on all network interfaces (which is required when not using # `network_mode=host`.) command: python ./main.py --listen 0.0.0.0