70 lines
1.2 KiB
HCL
70 lines
1.2 KiB
HCL
job "adminer" {
|
|
datacenters = ["dc1"]
|
|
type = "service"
|
|
|
|
group "adminer" {
|
|
count = 1
|
|
# Some affinity to stateful hosts?
|
|
|
|
network {
|
|
mode = "bridge"
|
|
port "adminer" {
|
|
host_network = "loopback"
|
|
to = 8080
|
|
}
|
|
}
|
|
|
|
service {
|
|
name = "adminer"
|
|
port = "adminer"
|
|
|
|
connect {
|
|
sidecar_service {
|
|
proxy {
|
|
local_service_port = 8080
|
|
|
|
upstreams {
|
|
destination_name = "mysql-server"
|
|
# TODO: how do I get these to not bind to the host eth0 address
|
|
local_bind_port = 4040
|
|
}
|
|
|
|
config {
|
|
protocol = "tcp"
|
|
}
|
|
}
|
|
}
|
|
|
|
sidecar_task {
|
|
resources {
|
|
cpu = 50
|
|
memory = 25
|
|
}
|
|
}
|
|
}
|
|
|
|
tags = [
|
|
"traefik.enable=true",
|
|
]
|
|
}
|
|
|
|
task "adminer" {
|
|
driver = "docker"
|
|
|
|
config {
|
|
image = "adminer"
|
|
ports = ["adminer"]
|
|
}
|
|
|
|
env = {
|
|
"ADMINER_DEFAULT_SERVER" = "${NOMAD_UPSTREAM_ADDR_mysql_server}"
|
|
}
|
|
|
|
resources {
|
|
cpu = 50
|
|
memory = 50
|
|
}
|
|
}
|
|
}
|
|
}
|