chore: backup infrastructure configurations [skip ci]
This commit is contained in:
@@ -24,28 +24,6 @@ job "foodplanner" {
|
||||
}
|
||||
}
|
||||
|
||||
# Prestart restore task
|
||||
task "restore" {
|
||||
driver = "docker"
|
||||
lifecycle {
|
||||
hook = "prestart"
|
||||
sidecar = false
|
||||
}
|
||||
config {
|
||||
# image = "litestream/litestream:latest"
|
||||
image = "litestream/litestream:0.3"
|
||||
args = [
|
||||
"restore",
|
||||
# "-if-replica-exists",
|
||||
#"-if-db-not-exists",
|
||||
"-o", "/alloc/tmp/meal_planner.db",
|
||||
"sftp://root:odroid@192.168.4.63/mnt/Shares/litestream/foodplanner.db"
|
||||
]
|
||||
volumes = [
|
||||
"/opt/nomad/data:/data"
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
task "app" {
|
||||
driver = "docker"
|
||||
@@ -53,16 +31,10 @@ job "foodplanner" {
|
||||
config {
|
||||
image = "ghcr.io/sstent/foodplanner:main"
|
||||
ports = ["http"]
|
||||
|
||||
# Mount the SQLite database file to persist data
|
||||
# Adjust the source path as needed for your environment
|
||||
volumes = [
|
||||
"/mnt/Public/configs/FoodPlanner_backups:/app/backups/",
|
||||
]
|
||||
}
|
||||
env {
|
||||
DATABASE_PATH = "/alloc/tmp"
|
||||
DATABASE_URL = "sqlite:////alloc/tmp/meal_planner.db"
|
||||
DATABASE_URL = "postgresql://postgres:postgres@master.postgres.service.dc1.consul/meal_planner"
|
||||
|
||||
}
|
||||
resources {
|
||||
cpu = 500
|
||||
@@ -78,22 +50,6 @@ job "foodplanner" {
|
||||
}
|
||||
}
|
||||
|
||||
# Litestream sidecar for continuous replication
|
||||
task "litestream" {
|
||||
driver = "docker"
|
||||
lifecycle {
|
||||
hook = "poststart" # runs after main task starts
|
||||
sidecar = true
|
||||
}
|
||||
config {
|
||||
# image = "litestream/litestream:0.5.0-test.10"
|
||||
image = "litestream/litestream:0.3"
|
||||
args = [
|
||||
"replicate",
|
||||
"/alloc/tmp/meal_planner.db",
|
||||
"sftp://root:odroid@192.168.4.63/mnt/Shares/litestream/foodplanner.db"
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user