Use volumes block to setting with common NFS setting (don't forget install NFS driver in your machine) in docker compose file
And when you need to attach the volume to same service, your can use volumes properties, set type to your volume and set option subpath in your