2022-03-14 22:56:06 +00:00
|
|
|
job "rediscommander" {
|
|
|
|
datacenters = ["dc1"]
|
|
|
|
type = "service"
|
|
|
|
|
|
|
|
group "rediscommander" {
|
|
|
|
count = 1
|
|
|
|
|
|
|
|
network {
|
|
|
|
mode = "bridge"
|
|
|
|
|
|
|
|
port "main" {
|
|
|
|
to = 8081
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
service {
|
|
|
|
name = "rediscommander"
|
|
|
|
port = "main"
|
|
|
|
|
|
|
|
tags = [
|
|
|
|
"traefik.enable=true",
|
2022-03-15 19:02:55 +00:00
|
|
|
"traefik.http.routers.rediscommander.entryPoints=websecure",
|
2022-03-14 22:56:06 +00:00
|
|
|
]
|
|
|
|
}
|
|
|
|
|
|
|
|
task "rediscommander" {
|
|
|
|
driver = "docker"
|
|
|
|
|
|
|
|
config {
|
|
|
|
image = "rediscommander/redis-commander:latest"
|
|
|
|
ports = ["main"]
|
|
|
|
}
|
|
|
|
|
2022-11-21 00:24:00 +00:00
|
|
|
template {
|
|
|
|
data = <<EOH
|
|
|
|
{{ range nomadService 1 (env "NOMAD_ALLOC_ID") "redis" -}}
|
|
|
|
REDIS_HOSTS=local:{{ .Address }}:{{ .Port }}
|
|
|
|
{{- end }}
|
|
|
|
EOH
|
|
|
|
env = true
|
|
|
|
destination = "env"
|
2022-03-14 22:56:06 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
resources {
|
|
|
|
cpu = 50
|
|
|
|
memory = 50
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|