[PR #3599] [CLOSED] Allow User to Change UID/GID Values at Container Runtime #4330

Closed
opened 2026-02-22 18:35:36 -05:00 by yindo · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Mintplex-Labs/anything-llm/pull/3599
Author: @nraboy
Created: 4/5/2025
Status: Closed

Base: masterHead: master


📝 Commits (1)

  • 30a388e Allow User to Change UID/GID Values

📊 Changes

2 files changed (+32 additions, -19 deletions)

View changed files

📝 docker/Dockerfile (+11 -11)
📝 docker/docker-entrypoint.sh (+21 -8)

📄 Description

In the current version, the documentation advertises changing the UID and GID values in the .env file, however it doesn't appear it actually does anything when inspecting the codebase.

The current codebase allows you to set the UID and GID values when building the image, which isn't particularly useful when deploying containers.

My proposed changes allow for optionally changing the UID and GID values at runtime. To make this possible, the entire Dockerfile is ran as the root user. In the docker-entrypoint.sh file, which is ran at container runtime, if the UID or GID values are set in the environment variables, then they will be changed for the anythingllm user. The application is started as the anythingllm user through gosu rather than continuing as root user.

This proposed change is valuable to avoid permission issues on mapped volumes.

Pull Request Type

  • feat
  • 🐛 fix
  • ♻️ refactor
  • 💄 style
  • 🔨 chore
  • 📝 docs

Relevant Issues

resolves #xxx

There is no matching issue ticket. I had the issue and opted to fix it myself, so I didn't feel an issue ticket was necessary.

What is in this change?

This change is strictly related to the Docker configuration. It allows users to deploy containers with specified UID and GID values as environment variables. Setting these values is optional because it will default to UID-1000 and GID-1000.

Additional Information

Developer Validations

  • I ran yarn lint from the root of the repo & committed changes
  • Relevant documentation has been updated
  • I have tested my code functionality
  • Docker build succeeds locally

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Mintplex-Labs/anything-llm/pull/3599 **Author:** [@nraboy](https://github.com/nraboy) **Created:** 4/5/2025 **Status:** ❌ Closed **Base:** `master` ← **Head:** `master` --- ### 📝 Commits (1) - [`30a388e`](https://github.com/Mintplex-Labs/anything-llm/commit/30a388efbe24ac494047cf827df1ef94326258d8) Allow User to Change UID/GID Values ### 📊 Changes **2 files changed** (+32 additions, -19 deletions) <details> <summary>View changed files</summary> 📝 `docker/Dockerfile` (+11 -11) 📝 `docker/docker-entrypoint.sh` (+21 -8) </details> ### 📄 Description In the current version, the documentation advertises changing the UID and GID values in the `.env` file, however it doesn't appear it actually does anything when inspecting the codebase. The current codebase allows you to set the UID and GID values when building the image, which isn't particularly useful when deploying containers. My proposed changes allow for optionally changing the UID and GID values at runtime. To make this possible, the entire `Dockerfile` is ran as the `root` user. In the `docker-entrypoint.sh` file, which is ran at container runtime, if the UID or GID values are set in the environment variables, then they will be changed for the `anythingllm` user. The application is started as the `anythingllm` user through `gosu` rather than continuing as `root` user. This proposed change is valuable to avoid permission issues on mapped volumes. ### Pull Request Type <!-- For change type, change [ ] to [x]. --> - [ ] ✨ feat - [x] 🐛 fix - [ ] ♻️ refactor - [ ] 💄 style - [ ] 🔨 chore - [ ] 📝 docs ### Relevant Issues <!-- Use "resolves #xxx" to auto resolve on merge. Otherwise, please use "connect #xxx" --> resolves #xxx There is no matching issue ticket. I had the issue and opted to fix it myself, so I didn't feel an issue ticket was necessary. ### What is in this change? <!-- Describe the changes in this PR that are impactful to the repo. --> This change is strictly related to the Docker configuration. It allows users to deploy containers with specified UID and GID values as environment variables. Setting these values is optional because it will default to UID-1000 and GID-1000. ### Additional Information <!-- Add any other context about the Pull Request here that was not captured above. --> ### Developer Validations <!-- All of the applicable items should be checked. --> - [x] I ran `yarn lint` from the root of the repo & committed changes - [x] Relevant documentation has been updated - [x] I have tested my code functionality - [x] Docker build succeeds locally --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
yindo added the pull-request label 2026-02-22 18:35:36 -05:00
yindo closed this issue 2026-02-22 18:35:36 -05:00
yindo changed title from [PR #3599] Allow User to Change UID/GID Values at Container Runtime to [PR #3599] [CLOSED] Allow User to Change UID/GID Values at Container Runtime 2026-06-05 15:18:01 -04:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Mintplex-Labs/anything-llm#4330