open-webui / pipelines

Pipelines: Versatile, UI-Agnostic OpenAI-Compatible Plugin Framework
MIT License
956 stars 300 forks source link

Run Docker Container with Custom User ID and Group ID for pipelines Folder Volume #175

Open chris-wgg opened 3 months ago

chris-wgg commented 3 months ago

Is your feature request related to a problem? Please describe. When mounting the pipeline volume for pipelines, the scripts are owned by root. This can be problematic when I want to delete failed pipeline scripts and files within the Docker volume itself. Having root ownership restricts the ability to manage these files easily and can lead to permission issues.

Describe the solution you'd like I would suggest running the Docker container with a custom User ID and Group ID. By specifying a non-root user, it will ensure that the files and folders created within the volume are owned by this user, thus avoiding permission issues and making it easier to manage the pipeline scripts from the host.

Additional context To implement this feature, the Dockerfile should be modified to accept custom User ID and Group ID as build arguments, and the container should run with these IDs. Additionally, the Docker run command or script should be adjusted to use these custom IDs. This will improve security and ease of file management within the mounted volume.

Example Dockerfile changes, e.g.:

ARG USER_ID=1001
ARG GROUP_ID=1001

RUN groupadd -g ${GROUP_ID} custom_user && \
    useradd -m -u ${USER_ID} -g ${GROUP_ID} custom_user

USER custom_user

Implementing this feature will greatly enhance the usability and security of the Docker setup for document scanning processes. Thank you for considering this request.