fix: chown /app before USER node so bun install can write node_modules#5
fix: chown /app before USER node so bun install can write node_modules#5TPFLegionaire wants to merge 1 commit into
Conversation
WORKDIR creates /app owned by root. USER node is set before bun install,
so bun cannot create node_modules in /app and the build fails with:
EACCES: Permission denied: could not create the "node_modules"
directory (mkdir)
Chown /app to node in the same RUN that installs bun, then proceed.
COPY --chown=node:node already handles the files, but the directory
itself needs to be writable too.
Repro: `make dev` on a fresh clone.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThe 🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Tip 💬 Introducing Slack Agent: The best way for teams to turn conversations into code.Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.
Built for teams:
One agent for your entire SDLC. Right inside Slack. 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 |
Problem
A fresh
make devfails on the frontend image build with:Cause
frontend/Dockerfile.devdoes:WORKDIR /appcreates/appowned by root.USER nodedrops privileges beforebun install, but/appitself is still root-owned, sobuncannot createnode_modulesinside it.COPY --chown=node:nodeonly fixes the copied files, not the parent directory.Fix
Chown
/apptonodein the sameRUNthat installs bun:RUN npm install -g bun && chown node:node /appOne-line change. No new layers.
Verification
make devsucceeds on a fresh clone; frontend starts andReady in 600msshows in logs.