From 30d084e69610ee6222c8760096ff7f936ee23234 Mon Sep 17 00:00:00 2001 From: Christoph Reiter Date: Tue, 2 Apr 2024 09:20:41 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=8B=20fix(Dockerfile):=20Create=20Nece?= =?UTF-8?q?ssary=20Directories=20at=20Build=20time=20(#2277)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When creating volumes for /app/client/public/images and /app/api/logs docker will inherit the permissions from the existing directores in the image. Since they are missing it defaults to root, and since librechat now uses the "node" user instead of "root" storing images, files and logs will fail. Fix by creating those directories in the docker image with the node user, so that if docker creates the volumes the permissions are inherited and the directories are owned by "node" and not "root". --- Dockerfile | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Dockerfile b/Dockerfile index d511fa58e8..fd087eae39 100644 --- a/Dockerfile +++ b/Dockerfile @@ -26,6 +26,10 @@ RUN npm install --no-audit ENV NODE_OPTIONS="--max-old-space-size=2048" RUN npm run frontend +# Create directories for the volumes to inherit +# the correct permissions +RUN mkdir -p /app/client/public/images /app/api/logs + # Node API setup EXPOSE 3080 ENV HOST=0.0.0.0