SeeJayEmm,
@SeeJayEmm@lemmy.procrastinati.org avatar

Everyone’s saying fstab but if Navidrome is in a docker container, just mount it as a volume on your container. I found this guide that seems to document it fairly well.

phoenixnap.com/kb/nfs-docker-volumes

This is how I’m handling NFS mounts in my docker stacks.

zaphod, (edited )
@zaphod@lemmy.ca avatar

Assuming systemd, create a file like


<span style="color:#323232;">/etc/systemd/system/dir-to-mount.mount
</span>

And then configure it per the systemd docs:

www.freedesktop.org/…/systemd.mount.html

Then modify the docker unit file to have a dependency on the mount unit so it’s guaranteed to be up before docker starts.

sabreW4K3,
@sabreW4K3@lemmy.tf avatar

Is this method superior to fstab?

zaphod, (edited )
@zaphod@lemmy.ca avatar

It has the benefit that the container can’t start before the mount point is up without any additional scripts or kludges, so no race conditions or surprise behaviour. Using fstab can’t provide that guarantee. The other option is Autofs but it’s messier to configure and may not ship out of the box on modern distros.

surewhynotlem,

fstab will do it, but the more important question is, what do you want to happen when it doesn’t mount properly? Do you want the system to fail to boot? Do you want navidrome to not run?

sabreW4K3,
@sabreW4K3@lemmy.tf avatar

Navidrome to not run would be optimal

surewhynotlem,

It’s probably best to wrap navidrome in a script that checks for the mount then.

sabreW4K3,
@sabreW4K3@lemmy.tf avatar

Thanks for the advice, I’ll look into it.

null,

Add it to your fstab

  • All
  • Subscribed
  • Moderated
  • Favorites
  • selfhosted@lemmy.world
  • localhost
  • All magazines
  • Loading…
    Loading the web debug toolbar…
    Attempt #