Fix/docker permision#584
Conversation
📝 WalkthroughWalkthroughUpdates Docker deployment configuration to use deterministic runtime user IDs (1000) and initializes a HuggingFace cache directory with proper ownership. Adds optional commented NVIDIA GPU passthrough configuration to docker-compose for future enablement. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
Dockerfile (1)
48-49: Make UID/GID configurable while keeping deterministic defaults.Lines 48-49 are effective for the common case, but hardcoding
1000can still break bind-mount writes on hosts where the user UID/GID differs. Consider build args with defaults so users can override when needed.Suggested diff
+ARG VOICEBOX_UID=1000 +ARG VOICEBOX_GID=1000 RUN groupadd -r -g 1000 voicebox && \ - useradd -r -g voicebox -u 1000 -m -s /bin/bash voicebox + useradd -r -g voicebox -u ${VOICEBOX_UID} -m -s /bin/bash voicebox-RUN groupadd -r -g 1000 voicebox && \ +RUN groupadd -r -g ${VOICEBOX_GID} voicebox && \ useradd -r -g voicebox -u ${VOICEBOX_UID} -m -s /bin/bash voicebox🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@Dockerfile` around lines 48 - 49, The Dockerfile currently hardcodes UID/GID 1000 in the RUN that creates the voicebox group/user; make them configurable by adding build arguments (e.g. ARG VOICEBOX_UID=1000 and ARG VOICEBOX_GID=1000) and use those variables in the groupadd and useradd commands (replace literal 1000 with the ARG values for -g and -u and for useradd -g), so builders can override at build time while keeping 1000 as the deterministic default.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@Dockerfile`:
- Around line 48-49: The Dockerfile currently hardcodes UID/GID 1000 in the RUN
that creates the voicebox group/user; make them configurable by adding build
arguments (e.g. ARG VOICEBOX_UID=1000 and ARG VOICEBOX_GID=1000) and use those
variables in the groupadd and useradd commands (replace literal 1000 with the
ARG values for -g and -u and for useradd -g), so builders can override at build
time while keeping 1000 as the deterministic default.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: ed5724ed-ad6b-43b0-9bb4-53dfe154d3c3
📒 Files selected for processing (2)
Dockerfiledocker-compose.yml
I resolve this Docker problem:
#542
Fix permission issues and add GPU support
The original Dockerfile creates the voicebox user with a system-assigned UID, which causes permission errors in two places:
HuggingFace cache — Docker initializes named volumes as root when the target directory doesn't exist in the image, so the voicebox user can't write to it.
Bind-mounted output directory — The unpredictable UID doesn't match the host user, causing soundfile to fail when saving generated audio.
Changes:
Pin voicebox to UID/GID 1000 so bind-mounts work without manual chown on the host.
Pre-create /home/voicebox/.cache/huggingface with correct ownership so the named volume inherits the right permissions.
Summary by CodeRabbit