From c5a91e7d22b8ba92080a9aea11756f69366b2dd0 Mon Sep 17 00:00:00 2001 From: emile Date: Wed, 9 Sep 2015 17:10:43 +0200 Subject: [PATCH] docker domain --- docker.go | 5 ++++- docker.tmpl | 2 +- træfik.toml | 1 + 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/docker.go b/docker.go index 597f2605d..80f3cec79 100644 --- a/docker.go +++ b/docker.go @@ -34,6 +34,7 @@ type DockerProvider struct { Watch bool Endpoint string dockerClient *docker.Client + Domain string } func (provider *DockerProvider) Provide(configurationChan chan <- *Configuration) { @@ -70,10 +71,12 @@ func (provider *DockerProvider) loadDockerConfig() *Configuration { templateObjects := struct { Containers []docker.Container - Hosts map[string][]docker.Container + Hosts map[string][]docker.Container + Domain string }{ containersInspected, hosts, + provider.Domain, } gtf.Inject(DockerFuncMap) tmpl, err := template.New("docker.tmpl").Funcs(DockerFuncMap).ParseFiles("docker.tmpl") diff --git a/docker.tmpl b/docker.tmpl index c7aecccf4..106b9edd7 100644 --- a/docker.tmpl +++ b/docker.tmpl @@ -8,5 +8,5 @@ backends = [{{range $container := $containers}}"backend-{{getBackend $container}}",{{end}}] [routes.route-{{$host}}.rules.rule-host-{{$host}}] category = "Host" - value = "{{$host}}.zenika.fr" + value = "{{$host}}.{{$.Domain}}" {{end}} \ No newline at end of file diff --git a/træfik.toml b/træfik.toml index 1df379680..9a10264ba 100644 --- a/træfik.toml +++ b/træfik.toml @@ -1,6 +1,7 @@ [docker] endpoint = "unix:///var/run/docker.sock" watch = true +domain = "toto.fr" [web] address = ":8010"