Not possible to change user / group identifiers for docker mounts?

I’ve set up Kanboard via docker-compose but I’d like to configure the user/group id of the files and folders on the data and plugins mounts. The nginx User that owns these files inside the container uses UID/GID values that map to system users on my host.

I can’t seem to find a way to change them through the docker compose file or by other means.

  • chown’ing the files gets reverted once the container starts, as expected
  • passing UID/GID or the commonly used PUID/PGID as env-variables in docker-compose has no effect
  • the user: $UID:$GID parameter in docker-compose has no effect

Am I missing something or am I right to assume that the kanboard/kanboard image doesn’t support changing the user / group identifiers?

Lets see what ChatGPT comes up with:

Yes, you are correct that the Kanboard Docker image does not support changing the user or group identifiers for the files and folders on the data and plugins mounts. The UID and GID values for these files and folders are hard-coded in the Docker image and cannot be changed through the Docker Compose file or by using environment variables.

However, there are a few possible workarounds that you can try to change the user and group identifiers for the files and folders on the data and plugins mounts.

One option is to use the --user option when running the docker run command to start the Kanboard container. This option allows you to specify the user and group identifiers for the container, and these values will be used for the files and folders on the data and plugins mounts. For example, you can use the following command to start the Kanboard container with a user and group identifier of 1000:

docker run --user 1000:1000 -v /path/to/data:/var/www/app/data -v /path/to/plugins:/var/www/app/plugins kanboard/kanboard

Another option is to use a custom Dockerfile to build a new Kanboard image that uses the desired user and group identifiers for the files and folders on the data and plugins mounts. To do this, you can start by copying the Dockerfile from the Kanboard GitHub repository and then modifying it to set the desired user and group identifiers for the www-data user. For example, you can add the following lines to the Dockerfile to set the user and group identifier to 1000:

RUN usermod -u 1000 www-data
RUN groupmod -g 1000 www-data

Once you have made these changes, you can build the new Kanboard image using the docker build command and then use it in your Docker Compose file instead of the official Kanboard image.

I hope this helps! Let me know if you have any other questions.