mirror of
https://github.com/containous/traefik.git
synced 2025-01-25 06:03:49 +03:00
docker domain
This commit is contained in:
parent
730fbfe9c5
commit
c5a91e7d22
@ -34,6 +34,7 @@ type DockerProvider struct {
|
|||||||
Watch bool
|
Watch bool
|
||||||
Endpoint string
|
Endpoint string
|
||||||
dockerClient *docker.Client
|
dockerClient *docker.Client
|
||||||
|
Domain string
|
||||||
}
|
}
|
||||||
|
|
||||||
func (provider *DockerProvider) Provide(configurationChan chan <- *Configuration) {
|
func (provider *DockerProvider) Provide(configurationChan chan <- *Configuration) {
|
||||||
@ -70,10 +71,12 @@ func (provider *DockerProvider) loadDockerConfig() *Configuration {
|
|||||||
|
|
||||||
templateObjects := struct {
|
templateObjects := struct {
|
||||||
Containers []docker.Container
|
Containers []docker.Container
|
||||||
Hosts map[string][]docker.Container
|
Hosts map[string][]docker.Container
|
||||||
|
Domain string
|
||||||
}{
|
}{
|
||||||
containersInspected,
|
containersInspected,
|
||||||
hosts,
|
hosts,
|
||||||
|
provider.Domain,
|
||||||
}
|
}
|
||||||
gtf.Inject(DockerFuncMap)
|
gtf.Inject(DockerFuncMap)
|
||||||
tmpl, err := template.New("docker.tmpl").Funcs(DockerFuncMap).ParseFiles("docker.tmpl")
|
tmpl, err := template.New("docker.tmpl").Funcs(DockerFuncMap).ParseFiles("docker.tmpl")
|
||||||
|
@ -8,5 +8,5 @@
|
|||||||
backends = [{{range $container := $containers}}"backend-{{getBackend $container}}",{{end}}]
|
backends = [{{range $container := $containers}}"backend-{{getBackend $container}}",{{end}}]
|
||||||
[routes.route-{{$host}}.rules.rule-host-{{$host}}]
|
[routes.route-{{$host}}.rules.rule-host-{{$host}}]
|
||||||
category = "Host"
|
category = "Host"
|
||||||
value = "{{$host}}.zenika.fr"
|
value = "{{$host}}.{{$.Domain}}"
|
||||||
{{end}}
|
{{end}}
|
@ -1,6 +1,7 @@
|
|||||||
[docker]
|
[docker]
|
||||||
endpoint = "unix:///var/run/docker.sock"
|
endpoint = "unix:///var/run/docker.sock"
|
||||||
watch = true
|
watch = true
|
||||||
|
domain = "toto.fr"
|
||||||
|
|
||||||
[web]
|
[web]
|
||||||
address = ":8010"
|
address = ":8010"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user