docker domain
This commit is contained in:
parent
730fbfe9c5
commit
c5a91e7d22
3 changed files with 6 additions and 2 deletions
|
@ -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")
|
||||
|
|
|
@ -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}}
|
|
@ -1,6 +1,7 @@
|
|||
[docker]
|
||||
endpoint = "unix:///var/run/docker.sock"
|
||||
watch = true
|
||||
domain = "toto.fr"
|
||||
|
||||
[web]
|
||||
address = ":8010"
|
||||
|
|
Loading…
Reference in a new issue