docker domain

This commit is contained in:
emile 2015-09-09 17:10:43 +02:00
parent 730fbfe9c5
commit c5a91e7d22
3 changed files with 6 additions and 2 deletions

View file

@ -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")

View file

@ -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}}

View file

@ -1,6 +1,7 @@
[docker]
endpoint = "unix:///var/run/docker.sock"
watch = true
domain = "toto.fr"
[web]
address = ":8010"