-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(comfy-ui): create developing image #79
Conversation
WalkthroughThe pull request introduces enhancements to the documentation and Dockerfile for setting up ComfyUI in a Docker environment. The Changes
Sequence DiagramsequenceDiagram
participant Dev as Developer
participant Docker as Docker Engine
participant ComfyUI as ComfyUI Container
Dev->>Docker: Build Docker image
Docker-->>Dev: Image built successfully
Dev->>Docker: Run ComfyUI container
Docker->>ComfyUI: Start application
ComfyUI-->>Docker: Container running
Poem
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (4)
ComfyUI/Dockerfile.local-cpu (4)
6-15
: Optimize image size by cleaning up apt cacheWhile the cache mounting is good for build performance, consider adding
apt-get clean
and removing/var/lib/apt/lists/*
to reduce the final image size.RUN --mount=type=cache,target=/var/cache/apt,rw --mount=type=cache,target=/var/lib/apt,rw \ apt-get update && apt-get install -y --no-install-recommends \ git \ git-lfs \ build-essential \ libgl1-mesa-glx \ wget \ curl \ unzip \ - ffmpeg + ffmpeg \ + && apt-get clean \ + && rm -rf /var/lib/apt/lists/*
35-36
: Use --system instead of --global for git configFor container environments,
--system
is more appropriate than--global
as it applies to all users and is more secure.RUN git config --local user.email "[email protected]" \ - && git config --global user.name "Container Builder" + && git config --system user.name "Container Builder"
73-74
: Consider removing git commit from DockerfileWhile the intention to track changes is good, committing changes during image build is unusual and might cause issues with image reproducibility. Consider documenting changes in the Dockerfile comments instead.
-# commit current state so we can trace changes -RUN git add . && git commit -m "chore: initial setup" +# Changes are tracked through Dockerfile version control
64-64
: Fix heredoc syntaxAdd a space before
]
in the heredoc syntax to comply with shell script best practices.-RUN <<EOF cat >> user/default/ComfyUI-Manager/config.ini +RUN << EOF cat >> user/default/ComfyUI-Manager/config.ini🧰 Tools
🪛 Hadolint (2.12.0)
[error] 64-64: Missing space before ]. Fix any mentioned problems and try again.
(SC1072)
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
ComfyUI/DEV.md
(1 hunks)ComfyUI/Dockerfile.local-cpu
(1 hunks)
✅ Files skipped from review due to trivial changes (1)
- ComfyUI/DEV.md
🧰 Additional context used
🪛 Hadolint (2.12.0)
ComfyUI/Dockerfile.local-cpu
[error] 64-64: Missing space before ]. Fix any mentioned problems and try again.
(SC1072)
🔇 Additional comments (4)
ComfyUI/Dockerfile.local-cpu (4)
17-26
: Well-structured environment configuration!Good use of ARG for version pinning and ENV for runtime configuration. The separation of build-time and runtime variables is well done.
38-52
: Excellent dependency management setup!Good practices observed:
- Proper virtual environment isolation
- Efficient cache usage with UV
- Correct PyTorch CPU variant selection
65-70
: Review security implications of weak security levelThe
security_level = weak
setting in ComfyUI Manager config might expose the application to security risks. Consider using a stronger security level unless there's a specific requirement for weak security.Would you like me to help research the security implications of this setting?
55-55
: Reconsider removing .gitignore fileRemoving the .gitignore file could lead to unintended files being tracked in git. Consider adding the submodule path to .gitmodules instead.
# Install PyTorch and its dependencies | ||
# see https://docs.astral.sh/uv/guides/integration/pytorch/#the-uv-pip-interface | ||
RUN --mount=type=cache,target=/root/.cache/uv \ | ||
uv pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cpu |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we need to install these libraries separately? Isn't the requirements.txt file in the ComfyUI root directory sufficient?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
requirements.txt
is not enough in case of GPU optimized versions pytorch as it ships different builds using different indexes.
ComfyUI/Dockerfile.local-cpu
Outdated
# On startup, ComfyUI is started at its default port; the IP address is changed from localhost to 0.0.0.0, because Docker is only forwarding traffic | ||
# to the IP address it assigns to the container, which is unknown at build time; listening to 0.0.0.0 means that ComfyUI listens to all incoming | ||
# traffic; the auto-launch feature is disabled, because we do not want (nor is it possible) to open a browser window in a Docker container | ||
CMD [".venv/bin/python", "main.py", "--listen", "0.0.0.0", "--port", "8188", "--disable-auto-launch", "--cpu", "--cpu-vae"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add new line please.
Are the parameters "--cpu" and "--cpu-vae" needed here? What if someone wants to use a GPU?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add new line please.
Sure, I’ll make the change.
That said, I believe stylistic or formatting issues are better addressed through automated tools rather than manual code review comments. Tools like automatic formatters and linters are widely available for most file types, including Dockerfiles. Using these tools ensures consistent formatting across the repository and saves time during reviews.
Currently, I don’t see even a basic configuration like an EditorConfig file in this repository. I’d be happy to contribute by adding such tools or configurations if the team agrees, as I also think consistent formatting is important.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are the parameters "--cpu" and "--cpu-vae" needed here? What if someone wants to use a GPU?
As far I understand we need to create a dedicated container for GPU users which will have optimized pytorch builds and drivers such as CUDA installed (or use Nvidia Docker images as base)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
🧹 Nitpick comments (1)
ComfyUI/Dockerfile.local-cpu (1)
55-55
: Consider safer alternative to removing .gitignore.Removing the entire .gitignore file might have unintended consequences for version control. Consider either:
- Temporarily moving it aside and restoring after submodule addition
- Or modifying only the relevant rules
-RUN rm .gitignore +RUN mv .gitignore .gitignore.bak && \ + git submodule add $COMFYUI_MANAGER_REPO custom_nodes/ComfyUI-Manager && \ + mv .gitignore.bak .gitignore
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
ComfyUI/Dockerfile.local-cpu
(1 hunks)
🧰 Additional context used
🪛 Hadolint (2.12.0)
ComfyUI/Dockerfile.local-cpu
[error] 64-64: Missing space before ]. Fix any mentioned problems and try again.
(SC1072)
⏰ Context from checks skipped due to timeout of 90000ms (1)
- GitHub Check: Analyze (javascript-typescript)
🔇 Additional comments (4)
ComfyUI/Dockerfile.local-cpu (4)
1-15
: Well-structured base setup with efficient caching!Good practices observed:
- Using UV pre-installed image for faster Python package management
- Proper caching of apt operations
- Comprehensive system dependencies
38-42
: Good implementation of relocatable virtual environment!The virtual environment setup with
--relocatable
flag aligns with the development needs for dependency isolation and portability.
86-86
: Consider parameterizing CPU/GPU options.The
--cpu
and--cpu-vae
flags are hardcoded, which limits the image's flexibility. Consider:
- Making these configurable via build arguments
- Using environment variables to toggle CPU/GPU mode at runtime
-CMD [".venv/bin/python", "main.py", "--listen", "0.0.0.0", "--port", "8188", "--disable-auto-launch", "--cpu", "--cpu-vae"] +ARG COMPUTE_TYPE="cpu" +ENV EXTRA_ARGS=${COMPUTE_TYPE:+"--$COMPUTE_TYPE --$COMPUTE_TYPE-vae"} +CMD .venv/bin/python main.py --listen 0.0.0.0 --port 8188 --disable-auto-launch $EXTRA_ARGS
21-26
: Verify ComfyUI version compatibility.The specified ComfyUI version (v0.3.10) should be verified for compatibility with the required features and stability.
✅ Verification successful
ComfyUI version is up-to-date and stable
The specified version (v0.3.10) is the latest stable release, with no reported critical issues. The version pinning is appropriate for production use.
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Check latest ComfyUI releases and any reported issues gh api repos/comfyanonymous/ComfyUI/releases/latest --jq .tag_name gh api repos/comfyanonymous/ComfyUI/issues --jq '.[] | select(.state == "open" and (.title | test("v0.3.10"; "i"))) | {title, html_url}'Length of output: 215
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 2
♻️ Duplicate comments (1)
ComfyUI/Dockerfile.local-cpu (1)
64-71
:⚠️ Potential issueDocument security implications and fix heredoc syntax.
- The weak security level allows execution of high-risk features
- The heredoc syntax is incorrect
-RUN <<EOF cat >> user/default/ComfyUI-Manager/config.ini +# Warning: Weak security level is for development only +# This allows execution of potentially unsafe custom nodes +RUN << EOF cat >> user/default/ComfyUI-Manager/config.ini [default] preview_method = auto file_logging = False security_level = weak skip_migration_check = True model_download_by_agent = False EOF🧰 Tools
🪛 Hadolint (2.12.0)
[error] 64-64: Missing space before ]. Fix any mentioned problems and try again.
(SC1072)
🧹 Nitpick comments (4)
ComfyUI/Dockerfile.local-cpu (4)
6-15
: Clean up apt lists after package installation.To reduce the image size, add
rm -rf /var/lib/apt/lists/*
after package installation:RUN --mount=type=cache,target=/var/cache/apt,rw --mount=type=cache,target=/var/lib/apt,rw \ apt-get update && apt-get install -y --no-install-recommends \ git \ git-lfs \ build-essential \ libgl1-mesa-glx \ wget \ curl \ unzip \ - ffmpeg + ffmpeg \ + && rm -rf /var/lib/apt/lists/*
21-26
: Enhance security with SHA pinning and verification.While version tags are used, they can be changed. Consider:
- Using commit SHAs instead of version tags
- Adding repository verification
-ARG COMFYUI_VERSION=v0.3.10 -ARG COMFYUI_MANAGER_VERSION=3.6.5 +# ComfyUI v0.3.10 +ARG COMFYUI_SHA=8973d5e0e5eeaa0d3a4710ab8eb6e1c5e1ca2787 +# ComfyUI Manager 3.6.5 +ARG COMFYUI_MANAGER_SHA=a935c8bb355a8d2e107e1fb11ace9cd6d2b9c9bbThen update the clone commands to use these SHAs.
80-81
: Enhance healthcheck for better reliability.The current healthcheck only verifies HTTP response. Consider:
- Adding a more comprehensive health endpoint
- Checking for successful model loading
- Adding timeout and retry parameters
HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \ - CMD curl -f http://localhost:8188/ || exit 1 + CMD curl -f http://localhost:8188/system/health || exit 1
86-86
: Document CPU-only runtime configuration.The
--cpu
and--cpu-vae
flags enforce CPU-only execution. Add a comment explaining:
- Why CPU-only mode is used
- How to modify for GPU support
- Performance implications
+# CPU-only configuration for development +# For GPU support: +# 1. Use appropriate base image (e.g., nvidia/cuda) +# 2. Remove --cpu and --cpu-vae flags +# 3. Install GPU versions of PyTorch packages CMD [".venv/bin/python", "main.py", "--listen", "0.0.0.0", "--port", "8188", "--disable-auto-launch", "--cpu", "--cpu-vae"]
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
ComfyUI/Dockerfile.local-cpu
(1 hunks)
🧰 Additional context used
🪛 Hadolint (2.12.0)
ComfyUI/Dockerfile.local-cpu
[error] 64-64: Missing space before ]. Fix any mentioned problems and try again.
(SC1072)
⏰ Context from checks skipped due to timeout of 90000ms (1)
- GitHub Check: Analyze (javascript-typescript)
uses: actions/checkout@v4 | ||
|
||
- name: Log in to GitHub Container Registry | ||
uses: docker/login-action@v3 |
Check warning
Code scanning / CodeQL
Unpinned tag for a non-immutable Action in workflow Medium
Uses Step
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v3 |
Check warning
Code scanning / CodeQL
Unpinned tag for a non-immutable Action in workflow Medium
Uses Step
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 2
🧹 Nitpick comments (1)
.github/workflows/comfyui-dev-container.yml (1)
3-8
: Consider adding more path triggers.Add paths for any files in the
ComfyUI
directory that could affect the build:on: push: paths: - ".github/workflows/comfyui-dev-container.yml" - "ComfyUI/Dockerfile.local-cpu" + - "ComfyUI/requirements.txt" + - "ComfyUI/scripts/**"
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
.github/workflows/comfyui-dev-container.yml
(1 hunks)
🧰 Additional context used
🪛 GitHub Check: CodeQL
.github/workflows/comfyui-dev-container.yml
[warning] 12-38: Workflow does not contain permissions
Actions Job or Workflow does not set permissions
[warning] 18-18: Unpinned tag for a non-immutable Action in workflow
Unpinned 3rd party Action 'Build and Push ComfyUI Dev Container' step Uses Step uses 'docker/login-action' with ref 'v3', not a pinned commit hash
[warning] 25-25: Unpinned tag for a non-immutable Action in workflow
Unpinned 3rd party Action 'Build and Push ComfyUI Dev Container' step Uses Step uses 'docker/setup-qemu-action' with ref 'v3', not a pinned commit hash
[warning] 28-28: Unpinned tag for a non-immutable Action in workflow
Unpinned 3rd party Action 'Build and Push ComfyUI Dev Container' step Uses Step uses 'docker/setup-buildx-action' with ref 'v3', not a pinned commit hash
[warning] 31-31: Unpinned tag for a non-immutable Action in workflow
Unpinned 3rd party Action 'Build and Push ComfyUI Dev Container' step Uses Step uses 'docker/build-push-action' with ref 'v6', not a pinned commit hash
⏰ Context from checks skipped due to timeout of 90000ms (1)
- GitHub Check: Analyze (javascript-typescript)
🔇 Additional comments (1)
.github/workflows/comfyui-dev-container.yml (1)
10-13
:⚠️ Potential issueAdd explicit permissions to follow security best practices.
The workflow should declare minimum required permissions:
jobs: build-and-push: + permissions: + contents: read + packages: write runs-on: ubuntu-latestLikely invalid or redundant comment.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
🧹 Nitpick comments (3)
.github/workflows/comfyui-dev-container.yml (1)
37-43
: Enhance Docker image configuration and versioning.Consider adding version tags and metadata labels for better container management.
Apply this diff to improve the build configuration:
with: context: ComfyUI file: ComfyUI/Dockerfile.local-cpu push: true provenance: true platforms: linux/amd64,linux/arm64 - tags: ghcr.io/super-protocol/solutions/comfyui-composer:latest + tags: | + ghcr.io/super-protocol/solutions/comfyui-composer:latest + ghcr.io/super-protocol/solutions/comfyui-composer:${{ github.sha }} + labels: | + org.opencontainers.image.title=ComfyUI Development Container + org.opencontainers.image.description=Base development image for ComfyUI + org.opencontainers.image.source=${{ github.server_url }}/${{ github.repository }} + org.opencontainers.image.revision=${{ github.sha }} + cache-from: type=gha + cache-to: type=gha,mode=maxComfyUI/Dockerfile.local-cpu (2)
6-14
: Consider using multi-stage builds to reduce image size.The current setup installs build dependencies that aren't needed at runtime.
Consider using a multi-stage build to separate build and runtime dependencies:
+FROM ghcr.io/astral-sh/uv:python3.12-bookworm-slim AS builder + +RUN apt-get update && apt-get install -y --no-install-recommends \ + git \ + git-lfs \ + build-essential + +# ... build steps ... + FROM ghcr.io/astral-sh/uv:python3.12-bookworm-slim RUN apt-get update && apt-get install -y --no-install-recommends \ - git \ - git-lfs \ - build-essential \ libgl1-mesa-glx \ wget \ curl \ unzip \ ffmpeg + +COPY --from=builder $COMFYUI_DIR $COMFYUI_DIR
79-81
: Improve healthcheck reliability.The current healthcheck might not detect all failure modes.
Consider adding more comprehensive health checks:
HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \ - CMD curl -f http://localhost:8188/ || exit 1 + CMD curl -f http://localhost:8188/ -o /dev/null \ + && python3 -c "import torch; print(torch.__version__)" \ + || exit 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
.github/workflows/comfyui-dev-container.yml
(1 hunks)ComfyUI/Dockerfile.local-cpu
(1 hunks)
🧰 Additional context used
🪛 GitHub Check: CodeQL
.github/workflows/comfyui-dev-container.yml
[warning] 23-23: Unpinned tag for a non-immutable Action in workflow
Unpinned 3rd party Action 'Build and Push ComfyUI Dev Container' step Uses Step uses 'docker/login-action' with ref 'v3', not a pinned commit hash
[warning] 30-30: Unpinned tag for a non-immutable Action in workflow
Unpinned 3rd party Action 'Build and Push ComfyUI Dev Container' step Uses Step uses 'docker/setup-qemu-action' with ref 'v3', not a pinned commit hash
[warning] 33-33: Unpinned tag for a non-immutable Action in workflow
Unpinned 3rd party Action 'Build and Push ComfyUI Dev Container' step Uses Step uses 'docker/setup-buildx-action' with ref 'v3', not a pinned commit hash
[warning] 36-36: Unpinned tag for a non-immutable Action in workflow
Unpinned 3rd party Action 'Build and Push ComfyUI Dev Container' step Uses Step uses 'docker/build-push-action' with ref 'v6', not a pinned commit hash
🪛 Hadolint (2.12.0)
ComfyUI/Dockerfile.local-cpu
[error] 63-63: Missing space before ]. Fix any mentioned problems and try again.
(SC1072)
⏰ Context from checks skipped due to timeout of 90000ms (1)
- GitHub Check: build-and-push
🔇 Additional comments (3)
.github/workflows/comfyui-dev-container.yml (2)
13-17
: LGTM! Permissions are well-defined and follow the principle of least privilege.The workflow correctly specifies the minimum required permissions:
packages: write
for pushing to container registrycontents: read
for checking out codeattestations: write
andid-token: write
for provenance
19-36
:⚠️ Potential issuePin GitHub Actions to specific commit hashes for security.
Using version tags like
v3
andv6
can be unsafe as tags can be moved to point to malicious commits.Apply this diff to pin the actions to specific commit hashes:
- uses: actions/checkout@v4 + uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 - uses: docker/login-action@v3 + uses: docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d # v3.0.0 - uses: docker/setup-qemu-action@v3 + uses: docker/setup-qemu-action@68827325e0b33c7199eb31dd4e31fbe9023e06e3 # v3.0.0 - uses: docker/setup-buildx-action@v3 + uses: docker/setup-buildx-action@f95db51fddba0c2d1ec667646a06c2ce06100226 # v3.0.0 - uses: docker/build-push-action@v6 + uses: docker/build-push-action@4a13e500e55cf31b7a5d59a38ab2040ab0f42f56 # v5.1.0Likely invalid or redundant comment.
🧰 Tools
🪛 GitHub Check: CodeQL
[warning] 23-23: Unpinned tag for a non-immutable Action in workflow
Unpinned 3rd party Action 'Build and Push ComfyUI Dev Container' step Uses Step uses 'docker/login-action' with ref 'v3', not a pinned commit hash
[warning] 30-30: Unpinned tag for a non-immutable Action in workflow
Unpinned 3rd party Action 'Build and Push ComfyUI Dev Container' step Uses Step uses 'docker/setup-qemu-action' with ref 'v3', not a pinned commit hash
[warning] 33-33: Unpinned tag for a non-immutable Action in workflow
Unpinned 3rd party Action 'Build and Push ComfyUI Dev Container' step Uses Step uses 'docker/setup-buildx-action' with ref 'v3', not a pinned commit hash
[warning] 36-36: Unpinned tag for a non-immutable Action in workflow
Unpinned 3rd party Action 'Build and Push ComfyUI Dev Container' step Uses Step uses 'docker/build-push-action' with ref 'v6', not a pinned commit hashComfyUI/Dockerfile.local-cpu (1)
63-70
: Document security implications of weak security level.The
security_level = weak
setting allows all risk levels to execute.Add a comment explaining this is for development only:
RUN << EOF cat >> user/default/ComfyUI-Manager/config.ini [default] preview_method = auto file_logging = False +# WARNING: Weak security level is for development only. +# This allows execution of all risk levels including high-risk features. +# Never use this setting in production environments. security_level = weak skip_migration_check = True model_download_by_agent = False EOFLet's verify if this configuration is used elsewhere:
✅ Verification successful
Add security warning comment as suggested
The review comment is correct. The
security_level = weak
setting appears only in the local development Dockerfile, and adding the warning comment is appropriate. The proposed documentation clearly warns about the security implications and helps prevent accidental use in production environments.🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Search for security level configuration rg -i "security_level.*=|SECURITY" ComfyUI/Length of output: 96
Script:
#!/bin/bash # Search for other Dockerfiles and config files fd Dockerfile fd -e ini -e md -e txt -i -g "*config*" fd -e md -i -g "*security*" fd -e md -i -g "*readme*"Length of output: 952
🧰 Tools
🪛 Hadolint (2.12.0)
[error] 63-63: Missing space before ]. Fix any mentioned problems and try again.
(SC1072)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (1)
.github/workflows/comfyui-dev-container.yml (1)
46-49
: Add source URL to container metadata labels.Enhance container discoverability by adding the source URL:
labels: | org.opencontainers.image.title=ComfyUI Development Container org.opencontainers.image.description=Base development image for ComfyUI + org.opencontainers.image.source=${{ github.server_url }}/${{ github.repository }} org.opencontainers.image.revision=${{ github.sha }}
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
.github/workflows/comfyui-dev-container.yml
(1 hunks)
🧰 Additional context used
🪛 GitHub Check: CodeQL
.github/workflows/comfyui-dev-container.yml
[warning] 23-23: Unpinned tag for a non-immutable Action in workflow
Unpinned 3rd party Action 'Build and Push ComfyUI Dev Container' step Uses Step uses 'docker/login-action' with ref 'v3', not a pinned commit hash
[warning] 30-30: Unpinned tag for a non-immutable Action in workflow
Unpinned 3rd party Action 'Build and Push ComfyUI Dev Container' step Uses Step uses 'docker/setup-qemu-action' with ref 'v3', not a pinned commit hash
[warning] 33-33: Unpinned tag for a non-immutable Action in workflow
Unpinned 3rd party Action 'Build and Push ComfyUI Dev Container' step Uses Step uses 'docker/setup-buildx-action' with ref 'v3', not a pinned commit hash
[warning] 36-36: Unpinned tag for a non-immutable Action in workflow
Unpinned 3rd party Action 'Build and Push ComfyUI Dev Container' step Uses Step uses 'docker/build-push-action' with ref 'v6', not a pinned commit hash
⏰ Context from checks skipped due to timeout of 90000ms (1)
- GitHub Check: build-and-push
🔇 Additional comments (2)
.github/workflows/comfyui-dev-container.yml (2)
1-17
: Well-structured workflow configuration!The workflow has:
- Clear naming
- Appropriate trigger paths
- Well-defined minimal permissions following the principle of least privilege
19-34
:⚠️ Potential issuePin action versions to specific commit hashes for security.
To prevent potential supply chain attacks, replace version tags with commit hashes:
- uses: actions/checkout@v4 + uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 - uses: docker/login-action@v3 + uses: docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d # v3.0.0 - uses: docker/setup-qemu-action@v3 + uses: docker/setup-qemu-action@68827325e0b33c7199eb31dd4e31fbe9023e06e3 # v3.0.0 - uses: docker/setup-buildx-action@v3 + uses: docker/setup-buildx-action@f95db51fddba0c2d1ec667646a06c2ce06100226 # v3.0.0 - uses: docker/build-push-action@v6 + uses: docker/build-push-action@4a13e500e55cf31b7a5d59a38ab2040ab0f42f56 # v5.1.0Likely invalid or redundant comment.
🧰 Tools
🪛 GitHub Check: CodeQL
[warning] 23-23: Unpinned tag for a non-immutable Action in workflow
Unpinned 3rd party Action 'Build and Push ComfyUI Dev Container' step Uses Step uses 'docker/login-action' with ref 'v3', not a pinned commit hash
[warning] 30-30: Unpinned tag for a non-immutable Action in workflow
Unpinned 3rd party Action 'Build and Push ComfyUI Dev Container' step Uses Step uses 'docker/setup-qemu-action' with ref 'v3', not a pinned commit hash
[warning] 33-33: Unpinned tag for a non-immutable Action in workflow
Unpinned 3rd party Action 'Build and Push ComfyUI Dev Container' step Uses Step uses 'docker/setup-buildx-action' with ref 'v3', not a pinned commit hash
b9b6112
to
180433a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 2
🧹 Nitpick comments (6)
ComfyUI/DEV.md (2)
3-5
: Consider adding build arguments for better version control.The build command could benefit from explicit version arguments:
-docker buildx build -f Dockerfile.local-cpu -t comfyui . +docker buildx build -f Dockerfile.local-cpu \ + --build-arg COMFYUI_VERSION=v0.3.10 \ + --build-arg COMFYUI_MANAGER_VERSION=3.6.5 \ + -t comfyui .
9-17
: Consider adding volume mounts for data persistence.The run command could benefit from volume mounts for models and outputs:
docker run \ --name comfyui \ --publish 8188:8188 \ # optionally to run in background --detach \ --restart unless-stopped \ + --volume ./models:/opt/ComfyUI/models \ + --volume ./output:/opt/ComfyUI/output \ comfyui.github/workflows/comfyui-dev-container.yml (1)
46-49
: Add more metadata labels for better container discoverability.Consider adding additional OpenContainers labels:
labels: | org.opencontainers.image.title=ComfyUI Development Container org.opencontainers.image.description=Base development image for ComfyUI org.opencontainers.image.revision=${{ github.sha }} + org.opencontainers.image.source=${{ github.server_url }}/${{ github.repository }} + org.opencontainers.image.licenses=MIT + org.opencontainers.image.created=${{ github.event.repository.updated_at }} + org.opencontainers.image.documentation=https://github.com/Super-Protocol/solutions/blob/main/ComfyUI/DEV.mdComfyUI/Dockerfile.local-cpu (3)
6-14
: Optimize package installation for smaller image size.Add cleanup steps and consider pinning package versions:
RUN apt-get update && apt-get install -y --no-install-recommends \ git \ git-lfs \ build-essential \ libgl1-mesa-glx \ wget \ curl \ unzip \ - ffmpeg + ffmpeg \ + && apt-get clean \ + && rm -rf /var/lib/apt/lists/*
79-80
: Enhance healthcheck robustness.Consider a more comprehensive health check:
- CMD curl -f http://localhost:8188/ || exit 1 + CMD curl -f http://localhost:8188/ -o /dev/null \ + && ps aux | grep -q "[p]ython.*main.py" \ + && [ -S /tmp/.X11-unix/X0 ] || exit 1
82-85
: Document CPU-only limitations.Add a comment explaining the implications of CPU-only mode:
-# On startup, ComfyUI is started at its default port; the IP address is changed from localhost to 0.0.0.0, because Docker is only forwarding traffic -# to the IP address it assigns to the container, which is unknown at build time; listening to 0.0.0.0 means that ComfyUI listens to all incoming -# traffic; the auto-launch feature is disabled, because we do not want (nor is it possible) to open a browser window in a Docker container +# Container Configuration: +# 1. Network: Listens on 0.0.0.0 to accept connections from Docker's network +# 2. Browser: Auto-launch disabled as container runs headless +# 3. Processing: +# - CPU-only mode for broad compatibility +# - Performance will be lower than GPU-enabled setups +# - For GPU support, use the GPU-specific Dockerfile CMD [".venv/bin/python", "main.py", "--listen", "0.0.0.0", "--port", "8188", "--disable-auto-launch", "--cpu", "--cpu-vae"]
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (3)
.github/workflows/comfyui-dev-container.yml
(1 hunks)ComfyUI/DEV.md
(1 hunks)ComfyUI/Dockerfile.local-cpu
(1 hunks)
🧰 Additional context used
🪛 GitHub Check: CodeQL
.github/workflows/comfyui-dev-container.yml
[warning] 23-23: Unpinned tag for a non-immutable Action in workflow
Unpinned 3rd party Action 'Build and Push ComfyUI Dev Container' step Uses Step uses 'docker/login-action' with ref 'v3', not a pinned commit hash
[warning] 30-30: Unpinned tag for a non-immutable Action in workflow
Unpinned 3rd party Action 'Build and Push ComfyUI Dev Container' step Uses Step uses 'docker/setup-qemu-action' with ref 'v3', not a pinned commit hash
[warning] 33-33: Unpinned tag for a non-immutable Action in workflow
Unpinned 3rd party Action 'Build and Push ComfyUI Dev Container' step Uses Step uses 'docker/setup-buildx-action' with ref 'v3', not a pinned commit hash
[warning] 36-36: Unpinned tag for a non-immutable Action in workflow
Unpinned 3rd party Action 'Build and Push ComfyUI Dev Container' step Uses Step uses 'docker/build-push-action' with ref 'v6', not a pinned commit hash
🪛 Hadolint (2.12.0)
ComfyUI/Dockerfile.local-cpu
[error] 63-63: Missing space before ]. Fix any mentioned problems and try again.
(SC1072)
⏰ Context from checks skipped due to timeout of 90000ms (1)
- GitHub Check: build-and-push
🔇 Additional comments (3)
.github/workflows/comfyui-dev-container.yml (2)
3-17
: Well-structured workflow configuration!The workflow triggers and permissions are properly configured for secure container publishing.
19-36
:⚠️ Potential issuePin action versions to specific commit hashes for security.
Replace version tags with commit hashes to prevent supply chain attacks:
- uses: actions/checkout@v4 + uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 - uses: docker/login-action@v3 + uses: docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d # v3.0.0 - uses: docker/setup-qemu-action@v3 + uses: docker/setup-qemu-action@68827325e0b33c7199eb31dd4e31fbe9023e06e3 # v3.0.0 - uses: docker/setup-buildx-action@v3 + uses: docker/setup-buildx-action@f95db51fddba0c2d1ec667646a06c2ce06100226 # v3.0.0 - uses: docker/build-push-action@v6 + uses: docker/build-push-action@4a13e500e55cf31b7a5d59a38ab2040ab0f42f56 # v5.1.0Likely invalid or redundant comment.
🧰 Tools
🪛 GitHub Check: CodeQL
[warning] 23-23: Unpinned tag for a non-immutable Action in workflow
Unpinned 3rd party Action 'Build and Push ComfyUI Dev Container' step Uses Step uses 'docker/login-action' with ref 'v3', not a pinned commit hash
[warning] 30-30: Unpinned tag for a non-immutable Action in workflow
Unpinned 3rd party Action 'Build and Push ComfyUI Dev Container' step Uses Step uses 'docker/setup-qemu-action' with ref 'v3', not a pinned commit hash
[warning] 33-33: Unpinned tag for a non-immutable Action in workflow
Unpinned 3rd party Action 'Build and Push ComfyUI Dev Container' step Uses Step uses 'docker/setup-buildx-action' with ref 'v3', not a pinned commit hash
[warning] 36-36: Unpinned tag for a non-immutable Action in workflow
Unpinned 3rd party Action 'Build and Push ComfyUI Dev Container' step Uses Step uses 'docker/build-push-action' with ref 'v6', not a pinned commit hashComfyUI/Dockerfile.local-cpu (1)
63-70
: 🛠️ Refactor suggestionDocument security implications of weak security level.
The weak security level allows all risk levels to execute. Add a comment explaining this is for development only:
RUN <<EOF cat >> user/default/ComfyUI-Manager/config.ini [default] preview_method = auto file_logging = False +# WARNING: weak security level is for development only +# This allows execution of all risk levels including high-risk features +# Do not use this setting in production environments security_level = weak skip_migration_check = True model_download_by_agent = False EOFLikely invalid or redundant comment.
🧰 Tools
🪛 Hadolint (2.12.0)
[error] 63-63: Missing space before ]. Fix any mentioned problems and try again.
(SC1072)
ComfyUI/DEV.md
Outdated
```sh | ||
git stash --all --include-untracked | ||
git checkout -b my-setup-changes | ||
git stash apply | ||
git add --all | ||
git commit -m 'Getting all my changes' | ||
git archive -o update.zip HEAD $(git diff --submodule=diff --name-only HEAD HEAD^) | ||
``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion
Add error handling to git commands.
The git commands should check for errors and existing changes:
-git stash --all --include-untracked
-git checkout -b my-setup-changes
-git stash apply
-git add --all
-git commit -m 'Getting all my changes'
-git archive -o update.zip HEAD $(git diff --submodule=diff --name-only HEAD HEAD^)
+# Check for uncommitted changes
+if ! git diff-index --quiet HEAD --; then
+ git stash --all --include-untracked
+fi
+
+# Create new branch if it doesn't exist
+if ! git show-ref --verify --quiet refs/heads/my-setup-changes; then
+ git checkout -b my-setup-changes
+else
+ echo "Branch my-setup-changes already exists"
+ exit 1
+fi
+
+# Apply stashed changes if they exist
+if git stash list | grep -q "stash@{0}"; then
+ git stash apply
+fi
+
+git add --all
+git commit -m 'Getting all my changes'
+
+# Create archive if there are changes
+if git diff --name-only HEAD HEAD^ &>/dev/null; then
+ git archive -o update.zip HEAD $(git diff --submodule=diff --name-only HEAD HEAD^)
+fi
RUN --mount=type=cache,target=/root/.cache/uv \ | ||
uv pip install -r requirements.txt |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion
Verify package integrity during installation.
Add hash verification for better security:
RUN --mount=type=cache,target=/root/.cache/uv \
- uv pip install -r requirements.txt
+ uv pip install -r requirements.txt --require-hashes
Generate requirements with hashes using:
uv pip freeze --all --require-hashes > requirements.txt
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
🧹 Nitpick comments (1)
.github/workflows/comfyui-dev-container.yml (1)
35-48
: Consider adding more metadata labels for better container discoverability.While the current labels are good, consider adding more OpenContainers labels for better container discoverability and compliance:
labels: | org.opencontainers.image.title=ComfyUI Development Container org.opencontainers.image.description=Base development image for ComfyUI + org.opencontainers.image.source=${{ github.server_url }}/${{ github.repository }} + org.opencontainers.image.created=${{ github.event.repository.updated_at }} + org.opencontainers.image.version=${{ github.sha }} + org.opencontainers.image.licenses=MIT🧰 Tools
🪛 GitHub Check: CodeQL
[warning] 36-36: Unpinned tag for a non-immutable Action in workflow
Unpinned 3rd party Action 'Build and Push ComfyUI Dev Container' step Uses Step uses 'docker/build-push-action' with ref 'v6', not a pinned commit hash
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
.github/workflows/comfyui-dev-container.yml
(1 hunks)
🧰 Additional context used
🪛 GitHub Check: CodeQL
.github/workflows/comfyui-dev-container.yml
[warning] 23-23: Unpinned tag for a non-immutable Action in workflow
Unpinned 3rd party Action 'Build and Push ComfyUI Dev Container' step Uses Step uses 'docker/login-action' with ref 'v3', not a pinned commit hash
[warning] 30-30: Unpinned tag for a non-immutable Action in workflow
Unpinned 3rd party Action 'Build and Push ComfyUI Dev Container' step Uses Step uses 'docker/setup-qemu-action' with ref 'v3', not a pinned commit hash
[warning] 33-33: Unpinned tag for a non-immutable Action in workflow
Unpinned 3rd party Action 'Build and Push ComfyUI Dev Container' step Uses Step uses 'docker/setup-buildx-action' with ref 'v3', not a pinned commit hash
[warning] 36-36: Unpinned tag for a non-immutable Action in workflow
Unpinned 3rd party Action 'Build and Push ComfyUI Dev Container' step Uses Step uses 'docker/build-push-action' with ref 'v6', not a pinned commit hash
⏰ Context from checks skipped due to timeout of 90000ms (1)
- GitHub Check: build-and-push
🔇 Additional comments (1)
.github/workflows/comfyui-dev-container.yml (1)
1-18
: LGTM! Well-configured workflow triggers and permissions.The workflow is correctly configured with:
- Specific path triggers to avoid unnecessary builds
- Explicit permissions following the principle of least privilege
- name: Check out repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Log in to GitHub Container Registry | ||
uses: docker/login-action@v3 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v3 | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pin GitHub Actions to specific commit hashes for better security.
Currently using version tags (@V3) which could potentially lead to supply chain attacks. Replace version tags with specific commit hashes for all actions:
actions/checkout@v4
docker/login-action@v3
docker/setup-qemu-action@v3
docker/setup-buildx-action@v3
Here's how to find and pin the commit hashes:
#!/bin/bash
# Description: Get the latest commit hashes for the GitHub Actions in use
# For each action, fetch the commit hash for the current version tag
for action in "actions/checkout@v4" "docker/login-action@v3" "docker/setup-qemu-action@v3" "docker/setup-buildx-action@v3" "docker/build-push-action@v6"; do
echo "Fetching commit hash for $action"
gh api repos/${action%@*}/commits/$(echo $action | cut -d@ -f2) --jq .sha
done
🧰 Tools
🪛 GitHub Check: CodeQL
[warning] 23-23: Unpinned tag for a non-immutable Action in workflow
Unpinned 3rd party Action 'Build and Push ComfyUI Dev Container' step Uses Step uses 'docker/login-action' with ref 'v3', not a pinned commit hash
[warning] 30-30: Unpinned tag for a non-immutable Action in workflow
Unpinned 3rd party Action 'Build and Push ComfyUI Dev Container' step Uses Step uses 'docker/setup-qemu-action' with ref 'v3', not a pinned commit hash
[warning] 33-33: Unpinned tag for a non-immutable Action in workflow
Unpinned 3rd party Action 'Build and Push ComfyUI Dev Container' step Uses Step uses 'docker/setup-buildx-action' with ref 'v3', not a pinned commit hash
e82c0a7
to
7a35039
Compare
uses: docker/setup-qemu-action@v3 | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 |
Check warning
Code scanning / CodeQL
Unpinned tag for a non-immutable Action in workflow Medium
Uses Step
|
||
- name: Docker meta | ||
id: meta | ||
uses: docker/metadata-action@v5 |
Check warning
Code scanning / CodeQL
Unpinned tag for a non-immutable Action in workflow Medium
Uses Step: meta
type=raw,value=latest,enable=${{ github.ref == 'refs/heads/main' && !startsWith(github.event_name, 'pull_request') }} | ||
|
||
- name: Build and push | ||
uses: docker/build-push-action@v6 |
Check warning
Code scanning / CodeQL
Unpinned tag for a non-immutable Action in workflow Medium
Uses Step
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (1)
ComfyUI/Dockerfile.local-cpu (1)
6-14
: Optimize package installation to reduce image size.Add cleanup steps after package installation to reduce the image size.
RUN apt-get update && apt-get install -y --no-install-recommends \ git \ git-lfs \ build-essential \ libgl1-mesa-glx \ wget \ curl \ unzip \ - ffmpeg + ffmpeg \ + && rm -rf /var/lib/apt/lists/*
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (3)
.github/workflows/comfyui-dev-container.yml
(1 hunks)ComfyUI/DEV.md
(1 hunks)ComfyUI/Dockerfile.local-cpu
(1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
- ComfyUI/DEV.md
🧰 Additional context used
🪛 GitHub Check: CodeQL
.github/workflows/comfyui-dev-container.yml
[warning] 23-23: Unpinned tag for a non-immutable Action in workflow
Unpinned 3rd party Action 'Build and Push ComfyUI Dev Container' step Uses Step uses 'docker/login-action' with ref 'v3', not a pinned commit hash
[warning] 30-30: Unpinned tag for a non-immutable Action in workflow
Unpinned 3rd party Action 'Build and Push ComfyUI Dev Container' step Uses Step uses 'docker/setup-qemu-action' with ref 'v3', not a pinned commit hash
[warning] 33-33: Unpinned tag for a non-immutable Action in workflow
Unpinned 3rd party Action 'Build and Push ComfyUI Dev Container' step Uses Step uses 'docker/setup-buildx-action' with ref 'v3', not a pinned commit hash
[warning] 37-37: Unpinned tag for a non-immutable Action in workflow
Unpinned 3rd party Action 'Build and Push ComfyUI Dev Container' step Uses Step: meta uses 'docker/metadata-action' with ref 'v5', not a pinned commit hash
[warning] 46-46: Unpinned tag for a non-immutable Action in workflow
Unpinned 3rd party Action 'Build and Push ComfyUI Dev Container' step Uses Step uses 'docker/build-push-action' with ref 'v6', not a pinned commit hash
🪛 Hadolint (2.12.0)
ComfyUI/Dockerfile.local-cpu
[error] 63-63: Missing space before ]. Fix any mentioned problems and try again.
(SC1072)
⏰ Context from checks skipped due to timeout of 90000ms (2)
- GitHub Check: Analyze (javascript-typescript)
- GitHub Check: build-and-push
🔇 Additional comments (10)
.github/workflows/comfyui-dev-container.yml (4)
13-17
: LGTM! Comprehensive permissions configuration.The permissions block correctly specifies all necessary scopes for the workflow operations.
20-20
: Pin GitHub Actions to specific commit hashes.Using version tags (@V3, @v4, @v5, @v6) could potentially lead to supply chain attacks. Replace version tags with specific commit hashes for better security.
Also applies to: 23-23, 30-30, 33-33, 37-37, 46-46
35-43
: LGTM! Well-structured tagging strategy.The metadata configuration implements a clear and logical tagging strategy that separates development, PR, and production builds.
🧰 Tools
🪛 GitHub Check: CodeQL
[warning] 37-37: Unpinned tag for a non-immutable Action in workflow
Unpinned 3rd party Action 'Build and Push ComfyUI Dev Container' step Uses Step: meta uses 'docker/metadata-action' with ref 'v5', not a pinned commit hash
45-56
: LGTM! Comprehensive build configuration.The build and push configuration includes all necessary elements:
- Multi-platform support (amd64/arm64)
- Security through provenance
- Clear image metadata
🧰 Tools
🪛 GitHub Check: CodeQL
[warning] 46-46: Unpinned tag for a non-immutable Action in workflow
Unpinned 3rd party Action 'Build and Push ComfyUI Dev Container' step Uses Step uses 'docker/build-push-action' with ref 'v6', not a pinned commit hashComfyUI/Dockerfile.local-cpu (6)
20-25
: LGTM! Clear version management and environment configuration.Explicit versioning and well-organized environment variables improve maintainability.
38-41
: LGTM! Well-configured virtual environment.The relocatable virtual environment setup aligns with the development purpose, making it easier to detect and replicate dependency changes.
49-50
: Add hash verification for package installation.Enhance security by verifying package integrity during installation.
63-70
: Document security implications and fix heredoc formatting.
- Add a comment explaining this is for development only and document security implications.
- Fix the heredoc formatting.
🧰 Tools
🪛 Hadolint (2.12.0)
[error] 63-63: Missing space before ]. Fix any mentioned problems and try again.
(SC1072)
79-80
: LGTM! Well-configured healthcheck.The healthcheck configuration follows best practices with appropriate intervals and retry settings.
85-85
: LGTM! Appropriate CPU-only configuration.The CPU-only configuration is suitable for this base development image, with GPU support planned for a separate image.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
♻️ Duplicate comments (2)
ComfyUI/Dockerfile.local-cpu (2)
49-50
: 🛠️ Refactor suggestionVerify package integrity during installation.
Add hash verification for better security:
RUN --mount=type=cache,target=/root/.cache/uv \ - uv pip install -r requirements.txt + uv pip install -r requirements.txt --require-hashesGenerate requirements with hashes using:
uv pip freeze --all --require-hashes > requirements.txt
74-81
:⚠️ Potential issueDocument security implications and fix heredoc syntax
- The
security_level = weak
setting needs documentation about its development-only usage and security implications.- Fix the heredoc syntax:
-RUN <<EOF cat >> user/default/ComfyUI-Manager/config.ini +RUN << EOF cat >> user/default/ComfyUI-Manager/config.ini [default] preview_method = auto file_logging = False security_level = weak skip_migration_check = True model_download_by_agent = False EOFAdd a comment explaining the security implications:
+# WARNING: This configuration is for development only. +# The weak security level allows all risk levels to execute. +# Never use this configuration in production environments. RUN << EOF cat >> user/default/ComfyUI-Manager/config.ini🧰 Tools
🪛 Hadolint (2.12.0)
[error] 74-74: Missing space before ]. Fix any mentioned problems and try again.
(SC1072)
🧹 Nitpick comments (3)
ComfyUI/Dockerfile.local-cpu (3)
6-14
: Optimize image size by cleaning up apt cacheAdd cleanup commands to reduce the image size:
RUN apt-get update && apt-get install -y --no-install-recommends \ git \ git-lfs \ build-essential \ libgl1-mesa-glx \ wget \ curl \ unzip \ - ffmpeg + ffmpeg \ + && rm -rf /var/lib/apt/lists/*
34-35
: Consider using more specific git configurationThe current git configuration uses generic email and name. Consider using more specific identifiers that reflect your organization:
-RUN git config --local user.email "[email protected]" \ +RUN git config --local user.email "[email protected]" \ && git config --global user.name "Container Builder"
90-91
: Enhance healthcheck reliabilityThe current healthcheck might fail if the working directory changes. Make it more robust:
HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \ - CMD curl -f http://localhost:8188/ || exit 1 + CMD cd $COMFYUI_DIR && curl -f http://localhost:8188/ || exit 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
ComfyUI/DEV.md
(1 hunks)ComfyUI/Dockerfile.local-cpu
(1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
- ComfyUI/DEV.md
🧰 Additional context used
🪛 Hadolint (2.12.0)
ComfyUI/Dockerfile.local-cpu
[error] 56-56: This is interpreted as a command name ending with '/'. Double check syntax.
(SC2287)
[error] 74-74: Missing space before ]. Fix any mentioned problems and try again.
(SC1072)
⏰ Context from checks skipped due to timeout of 90000ms (1)
- GitHub Check: build-and-push
🔇 Additional comments (1)
ComfyUI/Dockerfile.local-cpu (1)
20-25
: LGTM! Good version pinning and environment organization.The use of ARG for versions and clear environment variable organization promotes reproducibility and maintainability.
Create CompfyUI simple base image
Summary by CodeRabbit
Documentation
DEV.md
with detailed instructions for building and running the ComfyUI Docker image.New Features