2022-02-16 17:56:18 +00:00
|
|
|
job "adminer" {
|
|
|
|
datacenters = ["dc1"]
|
|
|
|
type = "service"
|
|
|
|
|
|
|
|
group "adminer" {
|
|
|
|
count = 1
|
|
|
|
# Some affinity to stateful hosts?
|
|
|
|
|
|
|
|
network {
|
|
|
|
mode = "bridge"
|
|
|
|
port "adminer" {
|
|
|
|
to = 8080
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
service {
|
2022-03-14 22:58:03 +00:00
|
|
|
name = "adminer"
|
2023-04-14 21:24:17 +00:00
|
|
|
provider = "nomad"
|
2022-02-16 17:56:18 +00:00
|
|
|
port = "adminer"
|
|
|
|
|
|
|
|
tags = [
|
|
|
|
"traefik.enable=true",
|
2022-03-15 19:02:55 +00:00
|
|
|
"traefik.http.routers.adminer.entryPoints=websecure",
|
2022-02-16 17:56:18 +00:00
|
|
|
]
|
|
|
|
}
|
|
|
|
|
|
|
|
task "adminer" {
|
|
|
|
driver = "docker"
|
|
|
|
|
|
|
|
config {
|
|
|
|
image = "adminer"
|
|
|
|
ports = ["adminer"]
|
|
|
|
}
|
|
|
|
|
2022-11-21 00:24:00 +00:00
|
|
|
template {
|
|
|
|
data = <<EOF
|
|
|
|
{{ range nomadService 1 (env "NOMAD_ALLOC_ID") "mysql-server" -}}
|
|
|
|
ADMINER_DEFAULT_SERVER={{ .Address }}:{{ .Port }}
|
|
|
|
{{- end }}
|
|
|
|
EOF
|
|
|
|
env = true
|
|
|
|
destination = "env"
|
2022-02-16 17:56:18 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
resources {
|
|
|
|
cpu = 50
|
|
|
|
memory = 50
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|