🐋 fix(Dockerfile): Create Necessary Directories at Build time (#2277)

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".
This commit is contained in:
Christoph Reiter 2024-04-02 09:20:41 +02:00 committed by GitHub
parent 93af814596
commit 30d084e696
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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