#11576: Update Dockerfile, change file ownership during copy to prevent long …
docker
stale
Cluster:
Docker Enhancements and Fixes
…build time.
The build time of the image was taking a very longtime on "chown" of "app" folder. applying this during copy phase saves a lot of time.
<!-- greptile_comment -->
<h2>Greptile Overview</h2>
<h3>Greptile Summary</h3>
This PR updates the `Dockerfile` to apply `--chown=node:node` during the full source `COPY`, and removes the subsequent `RUN chown -R node:node /app` step. Functionally, it keeps the image running as the non-root `node` user while avoiding an expensive recursive `chown` layer that was slowing builds.
<h3>Confidence Score: 5/5</h3>
- This PR is safe to merge with minimal risk.
- The change is narrowly scoped to the Docker build (replacing a post-copy recursive chown with `COPY --chown`), which should preserve the intended non-root runtime while reducing build overhead; no application logic is affected.
- Dockerfile
<!-- greptile_other_comments_section -->
<sub>(2/5) Greptile learns from your feedback when you react with thumbs up/down!</sub>
**Context used:**
- Context from `dashboard` - CLAUDE.md ([source](https://app.greptile.com/review/custom-context?memory=fd949e91-5c3a-4ab5-90a1-cbe184fd6ce8))
- Context from `dashboard` - AGENTS.md ([source](https://app.greptile.com/review/custom-context?memory=0d0c8278-ef8e-4d6c-ab21-f5527e322f13))
<!-- /greptile_comment -->
Most Similar PRs
#8376: Docker: inline chown to reduce image size and build time
by bugparty · 2026-02-03
92.5%
#5458: fix: set correct file ownership in Dockerfile (#5450)
by hakyonglee · 2026-01-31
87.1%
#11818: fix(docker): resolve build hang by using in-place ownership and opt...
by dilly · 2026-02-08
86.2%
#4238: Fix/docker migration atomicity
by ricardotrevisan · 2026-01-29
79.9%
#9102: Remove UI build for Discord-onlyUpdate Dockerfile
by nbliss16 · 2026-02-04
79.8%
#2609: bugfix: Docker build fails on main: .dockerignore excludes required...
by yanquankun · 2026-01-27
79.1%
#11333: fix(docker): align host directory ownership with container user
by liuxiaopai-ai · 2026-02-07
79.0%
#4116: Update Dockerfile to node 24
by kotov228 · 2026-01-29
78.8%
#7489: feat: add brew to Dockerfile
by k2589 · 2026-02-02
78.3%
#22491: Use multi-stage docker build to reduce image size from 4.72GB -> 2....
by mm-zacharydavison · 2026-02-21
78.3%