Fix permission issue on legacy builds

This commit is contained in:
B. Bergeron 2025-08-25 22:56:35 -04:00
parent 477f330415
commit 357f89a4bf
No known key found for this signature in database
GPG Key ID: 20A0A88F22238925

View File

@ -21,10 +21,16 @@ RUN mkdir -p \
# Also create a home directory for this user (-m), as some common Python tools # Also create a home directory for this user (-m), as some common Python tools
# (such as uv) interact with the users home directory. # (such as uv) interact with the users home directory.
RUN useradd -m comfyui RUN useradd -m comfyui
USER comfyui
# Install ComfyUI under /comfyui. # Install ComfyUI under /comfyui and set folder ownership to the comfyui user.
# With the legacy Docker builder (DOCKER_BUILDKIT=0), WORKDIR always creates missing
# directories as root (even if a different USER is active). To ensure the comfyui user
# can write inside, ownership must be fixed manually.
WORKDIR /comfyui WORKDIR /comfyui
RUN chown comfyui:comfyui .
# Install ComfyUI as ComfyUI
USER comfyui
# Set up a Python virtual environment and configure it as the default Python. # Set up a Python virtual environment and configure it as the default Python.
# #