fix(docker): guard .npmrc mv in non-root Dockerfile

The .npmrc file only exists in enterprise builds. Without the guard,
the mv fails with "No such file or directory" on open-source builds.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Yuneng Jiang 2026-04-03 15:08:25 -07:00
parent d1fae23b34
commit a3c2942d8d
No known key found for this signature in database

View file

@ -42,7 +42,7 @@ ENV LITELLM_NON_ROOT=true
# Build Admin UI using the upstream command order while keeping a single RUN layer
RUN mkdir -p /var/lib/litellm/ui && \
mv /app/.npmrc /app/.npmrc.bak && \
( [ -f /app/.npmrc ] && mv /app/.npmrc /app/.npmrc.bak || true ) && \
npm install -g npm@11.12.1 && \
npm install -g node-gyp@12.2.0 && \
ln -sf /usr/local/lib/node_modules/node-gyp /usr/lib/node_modules/npm/node_modules/node-gyp && \