job "navidrome-litefs" { datacenters = ["dc1"] type = "service" # We pin to Linux because LiteFS requires FUSE constraint { attribute = "${attr.kernel.name}" value = "linux" } group "navidrome" { count = 2 constraint { distinct_hosts = true } network { mode = "host" port "http" {} } # --- Setup Task --- task "setup" { driver = "docker" lifecycle { hook = "prestart" sidecar = false } config { image = "busybox" command = "mkdir" args = ["-p", "/alloc/sqlite"] network_mode = "host" } } # --- LiteFS Task --- task "litefs" { driver = "docker" config { image = "flyio/litefs:0.5" privileged = true # Needed for FUSE ports = ["http"] network_mode = "host" # 1. Bind mount for LiteFS internal data (chunks/WAL) # 2. Bind mount for the config # 3. Mount the shared alloc dir so we can mount FUSE on it volumes = [ "/mnt/configs/navidrome_litefs:/var/lib/litefs", "local/litefs.yml:/etc/litefs.yml" ] mounts = [ { type = "bind" source = "../alloc/sqlite" target = "/mnt/sqlite" bind_options = { propagation = "shared" } } ] } # Create the config file template { left_delimiter = "[[" right_delimiter = "]]" data = <