Files
NomadBackup/nomad_backup/20251115_142246/trilium.json
2025-11-21 13:07:40 -08:00

10 lines
2.9 KiB
JSON

{
"Format": "hcl2",
"JobID": "trilium",
"JobModifyIndex": 14153433,
"Namespace": "default",
"Source": "job \"trilium\" {\n datacenters = [\"dc1\"]\n type = \"service\"\n\n group \"trilium\" {\n count = 1\n\n # Prestart restore task\n task \"restore\" {\n driver = \"docker\"\n lifecycle {\n hook = \"prestart\"\n sidecar = false\n }\n config {\n image = \"litestream/litestream:latest\"\n args = [\n \"restore\",\n \"-if-replica-exists\",\n \"-if-db-not-exists\",\n \"-o\", \"/alloc/tmp/trilium.db\",\n \"sftp://root:odroid@192.168.4.63/mnt/Shares/litestream/trilium.db\"\n\n ]\n volumes = [\n \"/mnt/configs/trilium:/data\"\n ]\n }\n }\n\n # Main trilium task\n task \"trilium\" {\n driver = \"docker\"\n config {\n image = \"triliumnext/trilium:stable\"\n memory_hard_limit = \"2048\"\n ports = [\"http\"]\n volumes = [\n \"/mnt/configs/trilium:/home/node/trilium-data/data\", \n \"/mnt/Public/configs/trilium/backup:/home/node/trilium-data/backup\",\n \"/mnt/Public/configs/trilium/config:/home/node/trilium-data/config\"\n \n \n ]\n }\n env {\n TRILIUM_DATA_DIR=\"/home/node/trilium-data/data\"\n TRILIUM_BACKUP_DIR=\"/home/node/trilium-data/backup\"\n TRILIUM_CONFIG_INI_PATH= \t\"/home/node/trilium-data/config/config.ini\"\n\n }\n resources {\n cpu = 100\n memory = 128\n }\n service {\n name = \"trilium\"\n tags = [\n \"trilium\",\n \"web\",\n \"urlprefix-/trilium\",\n \"tools\",\n \"traefik.http.routers.triliumlan.rule=Host(`trilium.service.dc1.consul`)\",\n \"traefik.http.routers.triliumwan.rule=Host(`tril.fbleagh.duckdns.org`)\",\n \"traefik.http.routers.triliumwan.middlewares=dex@consulcatalog\",\n \"traefik.http.routers.triliumwan.tls=true\",\n ]\n port = \"http\"\n check {\n type = \"tcp\"\n interval = \"10s\"\n timeout = \"2s\"\n }\n }\n }\n\n # Litestream sidecar for continuous replication\n task \"litestream\" {\n driver = \"docker\"\n lifecycle {\n hook = \"poststart\" # runs after main task starts\n sidecar = true\n }\n config {\n image = \"litestream/litestream:latest\"\n args = [\n \"replicate\",\n \"/alloc/tmp/trilium.db\",\n \"sftp://root:odroid@192.168.4.63/mnt/Shares/litestream/trilium.db\"\n ]\n volumes = [\n \"/mnt/configs/trilium:/data\"\n ]\n \n }\n }\n\n network {\n port \"http\" {\n static = 6699\n to = 8080\n }\n }\n }\n}\n\n",
"VariableFlags": null,
"Variables": "",
"Version": 14
}