So my current setup is Immich is running on Linux on a mini PC via Docker Compose, and my Immich upload/library storage is on my Synology NAS via NFS and is working. My external library is also on the Synology via SMB/CIFS share.
I'm having a problem where if my Synology NAS reboots, the network hiccups, or I restart Docker, sometimes the SMB mount isn’t there yet, and the host ends up with local folders. The Docker then uses those empty local directories, and Immich marks tons of external assets as missing (“Asset Offline”) and moves them to trash. So the files aren’t actually gone; it's just that Immich is pointing to an empty local fallback path when the mount drops.
I added a mount-check service in compose that waits until the external paths exist and are non-empty before starting Immich. It now logs “NAS mount(s) look good.” I also verified mounts with findmnt, df -hT, and also confirmed what Docker is mounting using:
docker inspect immich_server --format '{{range .Mounts}}{{println .Source "->" .Destination}}{{end}}'
After correcting the bind mount source back to the real mounted path, the assets were restored and came back from trash.
How do I make this impossible long-term?
I want Immich/Docker to hard fail if the NAS mount isn’t present, and I want to prevent the host from ever using/creating local directories as a fallback.