I am deploying a Nextcloud install at home via Docker. I have the config written out, and my plan is to use storage from my TrueNAS box via an SMB mount
My question here is if there is any way to get the container to not start if the directory is not mounted? Usually this doesn’t really matter, but since the entire www directory will be unmounted, I have a feeling Nextcloud will re-create it in the now unmounted folder on the host
Or, should I not be using SMB? Should I be using NFS instead? I’ve never had great performance with NFS like I have with SMB in TrueNAS, so that’s why I default to SMB
Any advice welcome!
You could make the Nextcloud container so that it never restarts and make a simple bash script to start it that’s called, for example, start_nextcloud_docker.sh that checks for the SMB folder to be mounted and start the container through docker start nextcloud if the folder is mounted.
NFS is way too slow to do such things. Nextcloud is kinda hungry so any bottleneck will be noticeable. And when the storage is not keeping up with it just starts throwing random errors here and there, dropping reads or writes out of nowhere. I’ve had this experience when I was using a slow micro SD on Nextcloud on my Pi 4 8GB @2GHz. When I switched to a USB 3.0 SATA SSD all the issues went away.