traefik/providerTemplates/docker.tmpl
2015-09-15 18:35:32 +02:00

14 lines
No EOL
530 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}}.{{$.Domain}}"
{{end}}