ComfyUI/Dockerfile
User Name 1d5b9bc4fa Add Docker setup for ComfyUI with GitHub release tracking
- Add Dockerfile with CUDA 12.6 and Python 3.12 base
- Add docker-compose.yml with GPU support and volume mounts
- Add docker-entrypoint.sh script with venv management and OTEL support
- Add comfy-node-install.sh helper for custom node installation
- Update .gitignore to exclude Docker-related artifacts
- Entrypoint ensures frontend package matches requirements.txt version
- Optional OTEL instrumentation when OTEL_EXPORTER_OTLP_ENDPOINT is set
- Volume-mounted repo allows git checkout of release tags without rebuilds
2025-12-12 20:21:57 -06:00

38 lines
1.2 KiB
Docker

# Build argument for base image selection
ARG BASE_IMAGE=nvidia/cuda:12.6.3-cudnn-runtime-ubuntu24.04
# ----------------------
# Stage: Base Runtime
# ----------------------
FROM ${BASE_IMAGE} AS base
ENV DEBIAN_FRONTEND=noninteractive
ENV PIP_PREFER_BINARY=1
ENV PYTHONUNBUFFERED=1
# Install system dependencies
RUN apt-get update && apt-get install -y \
python3.12 python3.12-venv python3-pip git git-lfs wget \
libgl1 libglib2.0-0 libsm6 libxext6 libxrender1 \
ffmpeg \
espeak-ng libespeak-ng1 \
build-essential \
&& git lfs install \
&& ln -sf /usr/bin/python3.12 /usr/bin/python \
&& ln -sf /usr/bin/pip3 /usr/bin/pip \
&& apt-get autoremove -y && apt-get clean -y && rm -rf /var/lib/apt/lists/*
# OpenTelemetry packages will be installed in the venv by entrypoint script if needed
WORKDIR /app/ComfyUI
# Copy entrypoint and helper scripts
COPY scripts/docker-entrypoint.sh /app/ComfyUI/scripts/docker-entrypoint.sh
COPY scripts/comfy-node-install.sh /usr/local/bin/comfy-node-install
RUN chmod +x /app/ComfyUI/scripts/docker-entrypoint.sh && \
chmod +x /usr/local/bin/comfy-node-install
# Set entrypoint
ENTRYPOINT ["/app/ComfyUI/scripts/docker-entrypoint.sh"]