Here is something you can work on. You could try to mount your volumes as named volume as per this docker-compose file, so that docker takes care of permissions and ownership of the files.
If I understand it correctly you want to use an external drive or a drive partition ? You can’t directly use those partitions as named volume. You can also mount a SAMBA/CIF mounted volume from your external drive/drive partition or NFS (read here).
Do not change this part in the docker-compose I shared above. This files needs to be located where It can find it.