job "boundary-postgres" {
datacenters = ["dc1"]
type = "service"
group "postgres" {
count = 1
volume "postgres_data" {
type = "host"
read_only = false
source = "postgres_data"
}
network {
port "db" {
static = 5555
to = 5432
}
}
task "postgres" {
driver = "docker"
config {
image = "postgres"
ports = ["db"]
mount {
type = "volume"
target = "/var/lib/postgresql/data"
source = "postgres_data"
readonly = false
}
}
env {
POSTGRES_USER = "root"
POSTGRES_PASSWORD = "rootpassword"
POSTGRES_DB = "boundary"
PGDATA = "/var/lib/postgresql/data/pgdata"
}
logs {
max_files = 5
max_file_size = 15
}
resources {
cpu = 1000
memory = 1024
}
volume_mount {
volume = "postgres_data"
destination = "/var/lib/postgresql/data"
read_only = false
}
}
restart {
attempts = 10
interval = "5m"
delay = "25s"
mode = "delay"
}
}
}
In my nomad client i have this:
host_volume "postgres_data" {
path = "/mnt/brimble-volume/postgres"
read_only = false
}
I keep getting this error, Failed to create container configuration for image “postgres” (“sha256:b781f3a53e61df916d97dffe6669ef32b08515327ee3a398087115385b5178f5”): volumes are not enabled; cannot mount volume: “postgres_data”