Add support for Websocket port

This commit is contained in:
Thiago Trennepohl 2016-11-08 17:19:30 -02:00
parent e99b517833
commit df4cdb5762

View file

@ -129,9 +129,9 @@ upstream ws.{{ $host }} {
{{ if eq $addrLen 1 }}
{{ $address := index $container.Addresses 0 }}
{{ template "upstream" (dict "Container" $container "Address" $address "Network" $containerNetwork) }}
{{/* If more than one port exposed, use the one matching VIRTUAL_PORT env var, falling back to standard web port 80 */}}
{{/* If more than one port exposed, use the one matching SOCKET_PORT env var, falling back to standard web port 80 */}}
{{ else }}
{{ $port := coalesce $container.Env.VIRTUAL_PORT "80" }}
{{ $port := coalesce $container.Env.SOCKET_PORT "80" }}
{{ $address := where $container.Addresses "Port" $port | first }}
{{ template "upstream" (dict "Container" $container "Address" $address "Network" $containerNetwork) }}
{{ end }}