I declared my cifs shares like this in the past:
volumes:
cifs-volume:
driver_opts:
type: cifs
o: username=youruser,password=yourpassword,uid=1021,gid=100,vers=3.0
device: //192.168.x.y/share/subfolder
The permissions of your cifs user will be mapped against the uid and gid on your docker host and will have the same uid/gid inside the container.
I don’t recall the reason, but I eventually replaced all my cifs shares with nfsv4 shares.