[Bug]: File permission issue when using other users than 1000 or root #2939
Replies: 3 comments 3 replies
-
I've run into this same exact problem just now... had a user data-node, images, logs, meili_data_v1.7. I had this set in my .env file, fwiw: UID=1002 |
Beta Was this translation helpful? Give feedback.
-
Try following this: #1441 (reply in thread) You will need to build your own image, for which you will need to make use of the docker-compose.override.yml file: https://www.librechat.ai/docs/configuration/docker_override There are examples in You'll basically want it setup like this if you're using the default services:
api:
image: librechat
build:
context: .
target: node
args:
UID: ${UID}
GID: ${GID} |
Beta Was this translation helpful? Give feedback.
-
I'm also trying to get the non-default user to work, and I think I also need changes in the Dockerfile itself, even if I build my own image.
ls /app
LICENSE bun.lockb config docker-compose.override.yml.example images node_modules packages rag.yml
README.md charts deploy-compose.yml docker-compose.yml index.html package-lock.json pgdata2 utils
api client docker-compose.override.yml e2e logs package.json prettier.config.js Also note that the whole /app folder is owned by the "node" user, which is user 1000, but I want to run it is my systems I've worked around it by updating the
Or, as a diff: --- a/Dockerfile
+++ b/Dockerfile
@@ -3,15 +3,19 @@
# Base node image
FROM node:20-alpine AS node
+ARG UID=1000
+ARG GID=1000
+
RUN apk --no-cache add curl
RUN mkdir -p /app && chown node:node /app
WORKDIR /app
-USER node
-
+RUN mkdir -p /app/data /app/uploads && chown $UID:$GID /app/data /app/uploads
COPY --chown=node:node . .
+USER node
+
RUN \
# Allow mounting of thes Notable changes:
Alternatively, instead of making the Edit: Updated the Dockerfile; |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
What happened?
Issue:
I wanted to switch from root deployment to user deployment. During that I ran into several pitfalls.
My current user has gid/uid 1004. This is what I entered in the .env.
Many things did not work out well, but I think now I got it.
Suggestions:
Make the node:1000 user work consistently:
chown -R 1000:1000
for ./data-node ./images ./logs ./meilidata_v1.7`Alternative: Enable other users than 1000 to own the container:
chown -R $UID:GID
for ./data-node ./images ./logs ./meilidata_v1.7`Steps to Reproduce
docker compose up
with user 1000What browsers are you seeing the problem on?
No response
Relevant log output
No response
Screenshots
No response
Code of Conduct
Beta Was this translation helpful? Give feedback.
All reactions