Using Docker on Ubuntu, issues with permissions on external storage

I’m posting on “Installation” cause I’m not sure I have done everything right so I’m still stuck on that step trying to figure out if I did everything right.

I’m using Ubuntu Desktop 20.04.3 amd64 and I’m trying to install Nextcloud using Docker.

I used this docker-compose.yml script to get it up and running after a few attempts.
I am not sure if I did everything right but I encountered some issues down the line when I tried to use “External Storage”

What I wanted to do: To link an external directory on “/” on my ubuntu machine for example /MyData with the docker container so I can use it as an external storage and all users can share data into this folder.

What was the problem: After linking the directory /MyData with the container and added the folder on “External Storage” I could not move folders inside it using the web interface, I could not delete folders from it. I could not rename folders that were in it. I could not move folders from it to user’s personal space.
I was only able to add folders and files from my computer using drag and drop feature.
I was able to move, copy, and do everything with the files…
It was really strange…

I think I did something wrong or maybe the permissions on Ubuntu were not correct, although I gave permissions to “everyone”…

Let’s start again and first find something that works… Can anyone please help me to set it up on an Ubuntu machine? Has anyone tried anything similar?
I’d like to do it with docker

What I want to do:
To install Nextcloud using docker, with postresql or redis. If possible, I’d like to have all users’ data outside of the docker, inside a directory on my Ubuntu machine.

Thanks in advance.