traefik/templates/docker.tmpl

14 lines
No EOL
542 B
Cheetah

[backends]{{range .Containers}}
[backends.backend-{{getBackend .}}.servers.server-{{.Name | replace "/" "" | replace "." "-"}}]
url = "http://{{.NetworkSettings.IPAddress}}:{{getPort .}}"
weight = {{getWeight .}}
{{end}}
[frontends]{{range $host, $containers := .Hosts}}
[frontends.frontend-{{$host}}]
{{$container := index $containers 0}}
backend = "backend-{{getBackend $container}}"
[frontends.frontend-{{$host}}.routes.route-host-{{$host}}]
rule = "Host"
value = "{{$host}}.{{getDomain $container}}"
{{end}}