2020-11-13 17:26:04 +00:00
|
|
|
job "example" {
|
|
|
|
datacenters = ["dc1"]
|
|
|
|
|
|
|
|
group "cache" {
|
|
|
|
volume "test" {
|
2021-08-29 10:15:34 +00:00
|
|
|
type = "csi"
|
|
|
|
source = "${volume_id}"
|
|
|
|
access_mode = "single-node-writer"
|
|
|
|
attachment_mode = "block-device"
|
2020-11-13 17:26:04 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
task "redis" {
|
|
|
|
driver = "docker"
|
|
|
|
|
|
|
|
config {
|
2022-05-17 15:24:19 +00:00
|
|
|
image = "redis:7"
|
2020-11-13 17:26:04 +00:00
|
|
|
|
|
|
|
port_map {
|
|
|
|
db = 6379
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
volume_mount {
|
|
|
|
volume = "test"
|
|
|
|
destination = "/test"
|
|
|
|
}
|
|
|
|
|
|
|
|
resources {
|
|
|
|
cpu = 500
|
|
|
|
memory = 256
|
|
|
|
|
|
|
|
network {
|
|
|
|
mbits = 14
|
2020-11-13 19:16:15 +00:00
|
|
|
port "db" {}
|
2020-11-13 17:26:04 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|