Change db and media library folder

Hello,
I have installed xibo 4 docker on an ubuntu server. I have customized the ports by changing the cms_custom-ports.yml file. After modifying the cms_custom-ports.yml file I have executed the command docker-compose -f cms_custom-ports.yml up -d
The CMS works without problems, in fact, I have added a player and I have performed tests adding layouts. Everything works fine. Now, I would like to change the location of the database and the media library to a folder where I have mounted a shared resource of a NAS. On the ubuntu server I have already mounted the NAS folder in /media/resource which is where I want to host the database and the media library. How can I do this?