Merge pull request #186 from appropriate/prevent-generating-broken-config
Prevent generating broken config
This commit is contained in:
commit
ae85ec013b
2 changed files with 7 additions and 5 deletions
|
@ -17,7 +17,7 @@ RUN echo "daemon off;" >> /etc/nginx/nginx.conf \
|
||||||
RUN wget -P /usr/local/bin https://godist.herokuapp.com/projects/ddollar/forego/releases/current/linux-amd64/forego \
|
RUN wget -P /usr/local/bin https://godist.herokuapp.com/projects/ddollar/forego/releases/current/linux-amd64/forego \
|
||||||
&& chmod u+x /usr/local/bin/forego
|
&& chmod u+x /usr/local/bin/forego
|
||||||
|
|
||||||
ENV DOCKER_GEN_VERSION 0.3.9
|
ENV DOCKER_GEN_VERSION 0.4.0
|
||||||
|
|
||||||
RUN wget https://github.com/jwilder/docker-gen/releases/download/$DOCKER_GEN_VERSION/docker-gen-linux-amd64-$DOCKER_GEN_VERSION.tar.gz \
|
RUN wget https://github.com/jwilder/docker-gen/releases/download/$DOCKER_GEN_VERSION/docker-gen-linux-amd64-$DOCKER_GEN_VERSION.tar.gz \
|
||||||
&& tar -C /usr/local/bin -xvzf docker-gen-linux-amd64-$DOCKER_GEN_VERSION.tar.gz \
|
&& tar -C /usr/local/bin -xvzf docker-gen-linux-amd64-$DOCKER_GEN_VERSION.tar.gz \
|
||||||
|
|
10
nginx.tmpl
10
nginx.tmpl
|
@ -58,11 +58,13 @@ upstream {{ $host }} {
|
||||||
{{ end }}
|
{{ end }}
|
||||||
{{/* Else default to standard web port 80 */}}
|
{{/* Else default to standard web port 80 */}}
|
||||||
{{ else }}
|
{{ else }}
|
||||||
{{ range $address := $container.Addresses }}
|
{{ $address := where $container.Addresses "Port" "80" | first }}
|
||||||
{{ if eq $address.Port "80" }}
|
{{ if $address }}
|
||||||
# {{$container.Name}}
|
# {{$container.Name}}
|
||||||
server {{ $address.IP }}:{{ $address.Port }};
|
server {{ $address.IP }}:80;
|
||||||
{{ end }}
|
{{ else }}
|
||||||
|
# {{$container.Name}}
|
||||||
|
server {{ $container.IP }} down;
|
||||||
{{ end }}
|
{{ end }}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
Reference in a new issue