2019-06-01 14:02:49 +00:00
|
|
|
job "frontend" {
|
|
|
|
datacenters = ["dc1"]
|
|
|
|
type = "service"
|
2020-12-18 09:32:44 +00:00
|
|
|
priority = 80
|
2019-06-01 14:02:49 +00:00
|
|
|
|
|
|
|
group "traefik" {
|
|
|
|
task "server" {
|
|
|
|
driver = "docker"
|
|
|
|
|
|
|
|
config {
|
2020-01-14 07:33:58 +00:00
|
|
|
image = "amd64/traefik:1.7.20"
|
2019-06-01 14:02:49 +00:00
|
|
|
readonly_rootfs = true
|
2020-10-28 11:08:23 +00:00
|
|
|
network_mode = "host"
|
2019-06-01 14:02:49 +00:00
|
|
|
volumes = [
|
|
|
|
"secrets/traefik.toml:/etc/traefik/traefik.toml",
|
|
|
|
]
|
|
|
|
}
|
|
|
|
|
|
|
|
resources {
|
2020-05-21 09:54:32 +00:00
|
|
|
memory = 265
|
2019-06-01 14:02:49 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
service {
|
2020-05-23 15:25:29 +00:00
|
|
|
tags = [
|
|
|
|
"https",
|
|
|
|
"frontend",
|
|
|
|
"(diplonat (tcp_port 80 443))"
|
|
|
|
]
|
2020-10-28 11:08:23 +00:00
|
|
|
port = 443
|
|
|
|
address_mode = "driver"
|
2019-06-01 14:02:49 +00:00
|
|
|
name = "traefik"
|
|
|
|
check {
|
2020-05-05 14:34:16 +00:00
|
|
|
type = "http"
|
|
|
|
protocol = "http"
|
2020-10-28 11:08:23 +00:00
|
|
|
port = 8082
|
|
|
|
address_mode = "driver"
|
2020-05-05 14:34:16 +00:00
|
|
|
path = "/ping"
|
2019-06-01 14:02:49 +00:00
|
|
|
interval = "60s"
|
|
|
|
timeout = "5s"
|
|
|
|
check_restart {
|
|
|
|
limit = 3
|
|
|
|
grace = "90s"
|
|
|
|
ignore_warnings = false
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
template {
|
|
|
|
data = "{{ key \"configuration/traefik/traefik.toml\" }}"
|
|
|
|
destination = "secrets/traefik.toml"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|