Migrate Traefik
This commit is contained in:
parent
a2f8e11d06
commit
fc518df1c1
1 changed files with 30 additions and 13 deletions
|
@ -4,6 +4,13 @@ job "frontend" {
|
|||
priority = 80
|
||||
|
||||
group "traefik" {
|
||||
|
||||
network {
|
||||
port "http_port" { static = 80 }
|
||||
port "https_port" { static = 443 }
|
||||
port "admin_port" { static = 8082 }
|
||||
}
|
||||
|
||||
task "server" {
|
||||
driver = "docker"
|
||||
|
||||
|
@ -14,21 +21,36 @@ job "frontend" {
|
|||
volumes = [
|
||||
"secrets/traefik.toml:/etc/traefik/traefik.toml",
|
||||
]
|
||||
ports = [ "http_port", "https_port", "admin_port" ]
|
||||
}
|
||||
|
||||
resources {
|
||||
memory = 265
|
||||
}
|
||||
|
||||
template {
|
||||
data = file("../config/configuration/traefik/traefik.toml")
|
||||
destination = "secrets/traefik.toml"
|
||||
}
|
||||
|
||||
service {
|
||||
tags = [
|
||||
"https",
|
||||
"frontend",
|
||||
"(diplonat (tcp_port 80 443))"
|
||||
]
|
||||
port = 443
|
||||
address_mode = "driver"
|
||||
name = "traefik"
|
||||
name = "traefik-http"
|
||||
port = "http_port"
|
||||
tags = [ "(diplonat (tcp_port 80))" ]
|
||||
address_mode = "host"
|
||||
}
|
||||
|
||||
service {
|
||||
name = "traefik-https"
|
||||
port = "https_port"
|
||||
tags = [ "(diplonat (tcp_port 443))" ]
|
||||
address_mode = "host"
|
||||
}
|
||||
|
||||
service {
|
||||
name = "traefik-admin"
|
||||
port = "admin_port"
|
||||
address_mode = "host"
|
||||
check {
|
||||
type = "http"
|
||||
protocol = "http"
|
||||
|
@ -44,11 +66,6 @@ job "frontend" {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
template {
|
||||
data = "{{ key \"configuration/traefik/traefik.toml\" }}"
|
||||
destination = "secrets/traefik.toml"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Reference in a new issue