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

10 lines
2.5 KiB
JSON

{
"Format": "hcl2",
"JobID": "foodplanner",
"JobModifyIndex": 14064853,
"Namespace": "default",
"Source": "job \"foodplanner\" {\n datacenters = [\"dc1\"]\n\n type = \"service\"\n\n group \"app\" {\n count = 1\n\n network {\n port \"http\" {\n to = 8999\n }\n }\n\n service {\n name = \"foodplanner\"\n port = \"http\"\n\n check {\n type = \"http\"\n path = \"/\"\n interval = \"10s\"\n timeout = \"2s\"\n }\n }\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 image = \"litestream/litestream:0.3\"\n args = [\n \"restore\",\n # \"-if-replica-exists\",\n #\"-if-db-not-exists\",\n \"-o\", \"/alloc/tmp/meal_planner.db\",\n \"sftp://root:odroid@192.168.4.63/mnt/Shares/litestream/foodplanner.db\"\n ]\n volumes = [\n \"/opt/nomad/data:/data\"\n ]\n }\n }\n\n task \"app\" {\n driver = \"docker\"\n\n config {\n image = \"ghcr.io/sstent/foodplanner:main\"\n ports = [\"http\"]\n\n # Mount the SQLite database file to persist data\n # Adjust the source path as needed for your environment\n volumes = [\n \"/mnt/Public/configs/FoodPlanner_backups:/app/backups/\",\n ]\n }\n env {\n DATABASE_PATH = \"/alloc/tmp\"\n DATABASE_URL = \"sqlite:////alloc/tmp/meal_planner.db\"\n }\n resources {\n cpu = 500\n memory = 1024\n }\n\n # Restart policy\n restart {\n attempts = 3\n interval = \"10m\"\n delay = \"15s\"\n mode = \"fail\"\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:0.5.0-test.10\"\n image = \"litestream/litestream:0.3\"\n args = [\n \"replicate\",\n \"/alloc/tmp/meal_planner.db\",\n \"sftp://root:odroid@192.168.4.63/mnt/Shares/litestream/foodplanner.db\"\n ]\n }\n }\n }\n}",
"VariableFlags": null,
"Variables": "",
"Version": 0
}