ONLYOFFICE / Docker-DocumentServer

ONLYOFFICE Document Server is an online office suite comprising viewers and editors for texts, spreadsheets and presentations, fully compatible with Office Open XML formats: .docx, .xlsx, .pptx and enabling collaborative editing in real time.
GNU Affero General Public License v3.0
1.37k stars 470 forks source link

Feature request: Allow setting of UID and GID #708

Open alexanderwiller opened 7 months ago

alexanderwiller commented 7 months ago

Feature request

Allow setting of UID and GID used by the container.

By implementing this, when bind mounts are used, users are not forced to allocate the containers fixed UID/GIDs to Onlyoffice on the host system as well.

What is the current behavior?

UID 109 and GID 111 are used by the container and cannot be changed easily.

What is the expected behavior?

UID and GID can be set to custom values, e.g. by environment variables PUID and PGID, e.g. as with linuxserver.io images: https://github.com/linuxserver/docker-mariadb?tab=readme-ov-file#docker-compose-recommended-click-here-for-more-info

See also: https://github.com/ONLYOFFICE/Docker-DocumentServer/issues/40#issuecomment-295776609

DocumentServer Docker tag: latest, but all versions should be affected.

Host Operating System: Ubuntu 22.04 LTS

alexanderwiller commented 7 months ago

After further investigation, I see that a number of users and groups are present in the DocumentServer container:

redis:x:106:108::/var/lib/redis:/usr/sbin/nologin
postgres:x:107:109:PostgreSQL administrator,,,:/var/lib/postgresql:/bin/bash
rabbitmq:x:108:110:RabbitMQ messaging server,,,:/var/lib/rabbitmq:/usr/sbin/nologin

This makes me wonder, is it practical to allow setting all these IDs to custom values by means of some mechanism (e.g said env variables), or should I just use docker volumes that at least provide some level of UID/GID isolation, given that the files are not accessible by the host directly?

No matter what, I think it would be beneficial to allow mapping all services inside of the container to UIDs and GIDs that are not in use on the host by any other service.

igwyd commented 6 months ago

Hello @alexanderwiller, sorry for the late reply. Thank for detaled report, I created ticket #66520 with your proposal.