forked from phoenix/litellm-mirror
create litellm user to fix issue in k8s where prisma fails due to user nobody without home directory
This commit is contained in:
parent
39a2b41e16
commit
f301625014
1 changed files with 21 additions and 0 deletions
|
@ -9,6 +9,27 @@ FROM $LITELLM_BUILD_IMAGE as builder
|
||||||
# Set the working directory to /app
|
# Set the working directory to /app
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
|
ARG LITELLM_USER=litellm LITELLM_UID=1729
|
||||||
|
ARG LITELLM_GROUP=litellm LITELLM_GID=1729
|
||||||
|
|
||||||
|
RUN groupadd \
|
||||||
|
--gid ${LITELLM_GID} \
|
||||||
|
${LITELLM_GROUP} \
|
||||||
|
&& useradd \
|
||||||
|
--create-home \
|
||||||
|
--shell /bin/sh \
|
||||||
|
--gid ${LITELLM_GID} \
|
||||||
|
--uid ${LITELLM_UID} \
|
||||||
|
${LITELLM_USER}
|
||||||
|
|
||||||
|
# Allows user to update python install.
|
||||||
|
# This is necessary for prisma.
|
||||||
|
RUN chown -R ${LITELLM_USER}:${LITELLM_GROUP} /usr/local/lib/python3.11
|
||||||
|
|
||||||
|
# Set the HOME var forcefully because of prisma.
|
||||||
|
ENV HOME=/home/${LITELLM_USER}
|
||||||
|
USER ${LITELLM_USER}
|
||||||
|
|
||||||
# Install build dependencies
|
# Install build dependencies
|
||||||
RUN apt-get clean && apt-get update && \
|
RUN apt-get clean && apt-get update && \
|
||||||
apt-get install -y gcc python3-dev && \
|
apt-get install -y gcc python3-dev && \
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue