BytemarkHosting / docker-webdav

Docker image for running an Apache WebDAV server
MIT License
350 stars 166 forks source link

Easy way to run as different user (non-root). #27

Open bukowa opened 3 years ago

bukowa commented 3 years ago

Hello! Thanks for the project, i wonder what's the best way to run the container as a different user; for ex. while you already have the directories populated with files with custom gid/uid. Should the image respect that out-of-the box?

https://github.com/BytemarkHosting/docker-webdav/blob/master/2.4/docker-entrypoint.sh#L104 How could we easly swap port 80 ?

bukowa commented 3 years ago

Maybe chown -R www-data:www-data "/var/lib/dav" shoul not be run if the directory already exists?

qroac commented 3 years ago

I agree with @bukowa.
My use case is to use bytemark/webdav as DAV server providing access to the input folder of my document management system. Thus, the DMS server needs write access to all uploaded documents. So it would be great to either set the dav servers UID to the UID owning the mounted data folder or make it configurable for better integration as helper service to other applications.

bukowa commented 3 years ago

@qroac here is how i handled it, note: it's probably not secure

https://github.com/BytemarkHosting/docker-webdav/compare/master...bukforks:user-port