Files
NomadBackup/nomad_backup/postgres-backup.hcl
2026-02-14 02:02:16 +00:00

54 lines
1.0 KiB
HCL

job "postgres-backup" {
datacenters = ["dc1"]
type = "service"
constraint {
attribute = "${attr.kernel.name}"
value = "linux"
}
update {
stagger = "10s"
max_parallel = 1
healthy_deadline = "5m"
}
group "postgres-backup" {
count = 1
restart {
attempts = 6
interval = "1m"
delay = "10s"
mode = "delay"
}
task "postgres-backup" {
driver = "docker"
config {
image = "ghcr.io/sstent/docker-pg-backup:latest"
dns_servers = ["${attr.unique.network.ip-address}","192.168.4.250","8.8.8.8"]
memory_hard_limit = "2048"
volumes = [
"/mnt/Public/configs/postgres_backups:/backups",
]
}
env {
POSTGRES_HOST= "replica.postgres.service.dc1.consul"
POSTGRES_USER= "postgres"
POSTGRES_PASS= "postgres"
}
resources {
cpu = 256 # 500 MHz
memory = 64 # 128MB
} #end resources
} #end task
} # end group
} # end job