Docker-compose change ownership of mounted volumes

I’m running on raspberrypi3 and I’ve installed NextCloud using a docker-compose.yml file.
The problem is when i mount some volumes the folder is created as root on the host platform (the raspberry). I know this is the default behaviour because docker runs as root but is quite uncomfortable to access data on the raspberry using the pi user (I don’t want use sudo)

I tried almost everything, I used the option

user: 1000

in the docker-compose.yml but it doesn’t change anything (I got some errors inside the container to access /var/www/html/ folder).

I also tried to create my own Dockerfile using this commands:

FROM nextcloud
RUN mkdir /var/www/html
RUN chown -R pi:pi /var/www/html

It didn’t work even in this case.

Is there a way to create the folder on the raspberry as the pi user instead of root?
Many Thanks

mount your docker volume on the host with bindfs?

Thanks @Reiner_Nippes, bindfs could be an option but this force me to mount every single folders in the fstab at the start. Is there another way to change the owner of the folder?

The best solution is to set this option in the docker-compose.yml, in this way I could backup that file and restore my configuration very quickly.