docker port

This commit is contained in:
emile 2015-09-09 11:39:41 +02:00
parent d3071ca110
commit 0af872e661

View file

@ -1,7 +1,16 @@
[backends]{{range .Containers}}
[backends.backend-{{.Config.Hostname}}]
[backends.backend-{{.Config.Hostname}}.servers.server-{{.Config.Hostname}}]
url = "http://{{.NetworkSettings.IPAddress}}:80"
{{/* Only one exposed port! */}}
{{if eq (len .Config.ExposedPorts) 1}}
{{$ip := .NetworkSettings.IPAddress}}
{{range $keyPort, $valuePort := .Config.ExposedPorts}}
url = "http://{{$ip}}:{{$keyPort.Port}}"
{{end}}
{{else}}
{{end}}
{{end}}
[routes]{{range .Containers}}