Daily postgresql backups.

This commit is contained in:
2023-11-19 07:17:26 +00:00
parent 3d3439f2ab
commit 7328799fd3

View File

@@ -10,6 +10,7 @@ job "postgres" {
to = 9187 to = 9187
} }
port "admin" { } port "admin" { }
port "backup_healthckeck" { }
} }
task "postgres" { task "postgres" {
@@ -105,6 +106,25 @@ EOH
] ]
} }
} }
task "backup" {
driver = "docker"
config {
image = "prodrigestivill/postgres-backup-local"
ports = [ "backup_healthckeck" ]
volumes = [ "/data/compute/appdata/pgbackup:/backups" ]
}
env {
POSTGRES_DB = "${NOMAD_HOST_db}"
POSTGRES_USER = "postgres"
POSTGRES_PASSWORD = "${var.default_password}"
POSTGRES_CLUSTER = "TRUE"
POSTGRES_EXTRA_OPTS = ""
HEALTHCHECK_PORT = "${NOMAD_PORT_backup_healthckeck}"
}
}
} }
} }