1
0
Fork 0

Adds traefik.frontend. rule and value labels in Docker and Marathon. Fixes #64. Fixes #73

This commit is contained in:
emile 2015-10-23 09:49:19 +02:00
parent 5dea2e7902
commit d671cc3821
6 changed files with 157 additions and 95 deletions

View file

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