51 lines
872 B
HCL
51 lines
872 B
HCL
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",
|
|
"traefik.http.routers.rediscommander.entryPoints=websecure",
|
|
]
|
|
}
|
|
|
|
task "rediscommander" {
|
|
driver = "docker"
|
|
|
|
config {
|
|
image = "rediscommander/redis-commander:latest"
|
|
ports = ["main"]
|
|
}
|
|
|
|
template {
|
|
data = <<EOH
|
|
{{ range nomadService 1 (env "NOMAD_ALLOC_ID") "redis" -}}
|
|
REDIS_HOSTS=local:{{ .Address }}:{{ .Port }}
|
|
{{- end }}
|
|
EOH
|
|
env = true
|
|
destination = "env"
|
|
}
|
|
|
|
resources {
|
|
cpu = 50
|
|
memory = 50
|
|
}
|
|
}
|
|
}
|
|
}
|