Store Volumes on a CIFS NAS

I can not imagine that any NAS exist that doesn’t come with NFS out of the box.
All Synology and QNAP boxes should allow exposing a share via NFS.

I use NFS v4 for most of my remote shares, and CIFS for special cases, where using NFS v4 resulted in odd permissions, that prevented other CIFS clients to access the data. I don’t recall what the exact problem was, but it could be a Synology specific problem. While CIFS makes it necessary to provide credentials in your volume declaration, NFS doesn’t.

I declare my volumes like this:

volumes:
  cifs_volume:
    driver_opts:
      type: cifs 
      o: username=xxx,password=yyyy,uid=33450,gid=100,vers=3.0
      device: //192.168.x.x/myshare

  nfs_volume:
    driver_opts:
      type: nfs 
      o: addr=192.168.x.x,nfsvers=4
      device: :/volume1/myshare

The cifs mounts implicitly use file_mode=0755, dir_mode=0755 on my system. Aligning uid and gid in the cifs option with the uid/gid of the process inside the container is key to use 755 permissions instead of 777 permissions.