I’m not sure I completely understand why it’s failing. I also use TrueNAS on my end for container storage, and it seems to work fine. However, I’m using Kubernetes for mine and you’re using Docker Compose for yours, and I’ve not tried Docker Compose with TrueNAS-backed storage yet.
Usually, the problem comes down to username. I had to use the “mapall” option in the share, and map it to the username I set aside for it. Then, in the data store, I set the permissions of it to be owned by that user. But if I’m understanding your post correctly, it sounds like you’ve already done that.
To best understand the issue, try to manually “walk through” the directories and create test files. As a user on the Ubuntu system, mount the NFS share, and via the commandline just try to do something like “touch testfile.txt” to see if you can write, and traverse the directories down to where the container should be writing.
I know that isn’t much, but I’d probably be more helpful if I was doing it the same way as you. Since I have my containers set up in kubernetes, I’m creating a physical volume call, and a physical volume claim call, and Kubernetes is managing that. But at the same time, if TrueNAS has the datastore set to the proper user ID for the owner, and you recursively set that, and you set the mapall option to that same user, there really isn’t anything else I can think of that would be required.
Also, ensure that the NFS share in TrueNAS has the IP address of your server whitelisted.