homelab-nomad/databases/adminer.nomad

52 lines
891 B
Plaintext
Raw Normal View History

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"
provider = "nomad"
2022-02-16 17:56:18 +00:00
port = "adminer"
tags = [
"traefik.enable=true",
"traefik.http.routers.adminer.entryPoints=websecure",
2022-02-16 17:56:18 +00:00
]
}
task "adminer" {
driver = "docker"
config {
image = "adminer"
ports = ["adminer"]
}
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
}
}
}
}