Skip to content

Commit 9795b82

Browse files
committed
support overriding the dinghy domain
1 parent d54dbd0 commit 9795b82

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

Dockerfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,5 @@ COPY *.conf /etc/nginx/conf.d/
1717

1818
# override nginx-proxy templating
1919
COPY nginx.tmpl Procfile reload-nginx /app/
20+
21+
ENV DOMAIN_TLD docker

nginx.tmpl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
{{ $CurrentContainer := where $ "Hostname" .Env.HOSTNAME | first }}
2+
{{ $TLD := .Env.DOMAIN_TLD }}
23

34
# If we receive X-Forwarded-Proto, pass it through; otherwise, pass along the
45
# scheme used to connect to this server
@@ -81,7 +82,7 @@ server {
8182

8283
{{ range $project, $projContainers := groupByLabel $ "com.docker.compose.project" }}
8384
{{ range $service, $containers := groupByLabel $projContainers "com.docker.compose.service" }}
84-
{{ $host := printf "%s.%s.%s" $service $project "docker" }}
85+
{{ $host := printf "%s.%s.%s" $service $project $TLD }}
8586
{{/* Don't create the implicit host if an explicit VIRTUAL_HOST with the same name has been defined */}}
8687
{{ if eq 0 (len (where $ "Env.VIRTUAL_HOST" $host)) }}
8788
{{ $container := first $containers }}

0 commit comments

Comments
 (0)