Skip to content

Commit 7e2da4f

Browse files
committed
Non root docker build fix
1 parent 639c244 commit 7e2da4f

File tree

1 file changed

+21
-12
lines changed

1 file changed

+21
-12
lines changed

docker/Dockerfile.non_root

Lines changed: 21 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -20,24 +20,33 @@ COPY . .
2020
ENV LITELLM_NON_ROOT=true
2121

2222
# Build Admin UI
23-
RUN mkdir -p /tmp/litellm_ui && \
24-
cd ui/litellm-dashboard && \
25-
if [ -f "../../enterprise/enterprise_ui/enterprise_colors.json" ]; then \
26-
cp ../../enterprise/enterprise_ui/enterprise_colors.json ./ui_colors.json; \
27-
fi && \
28-
npm install && \
29-
npm run build && \
30-
cp -r ./out/* /tmp/litellm_ui/ && \
31-
cd /tmp/litellm_ui && \
23+
RUN mkdir -p /tmp/litellm_ui
24+
25+
RUN npm install -g npm@latest && npm cache clean --force
26+
27+
RUN cd /app/ui/litellm-dashboard && \
28+
if [ -f "/app/enterprise/enterprise_ui/enterprise_colors.json" ]; then \
29+
cp /app/enterprise/enterprise_ui/enterprise_colors.json ./ui_colors.json; \
30+
fi
31+
32+
RUN cd /app/ui/litellm-dashboard && rm -f package-lock.json
33+
34+
RUN cd /app/ui/litellm-dashboard && npm install --legacy-peer-deps
35+
36+
RUN cd /app/ui/litellm-dashboard && npm run build
37+
38+
RUN cp -r /app/ui/litellm-dashboard/out/* /tmp/litellm_ui/
39+
40+
RUN cd /tmp/litellm_ui && \
3241
for html_file in *.html; do \
3342
if [ "$html_file" != "index.html" ] && [ -f "$html_file" ]; then \
3443
folder_name="${html_file%.html}" && \
3544
mkdir -p "$folder_name" && \
3645
mv "$html_file" "$folder_name/index.html"; \
3746
fi; \
38-
done && \
39-
cd /app/ui/litellm-dashboard && \
40-
rm -rf ./out
47+
done
48+
49+
RUN cd /app/ui/litellm-dashboard && rm -rf ./out
4150

4251
# Build package and wheel dependencies
4352
RUN rm -rf dist/* && python -m build && \

0 commit comments

Comments
 (0)