Set permissions as part of the Docker image entrypoint
To solve the problem with root
permissions on newly created directories (such as in bind-mounts not existing on the host), we can think about an approach to update the permission as part of the entrypoint when starting the container.
Compare this and that.