From b9d7bde5cdcc96eae34eefe01c527a20034e29c8 Mon Sep 17 00:00:00 2001 From: Jason Wilder Date: Sun, 8 Jun 2014 10:14:51 -0600 Subject: [PATCH] Support multiple VIRTUAL_HOSTs per container. Fixes #3 --- Dockerfile | 4 ++-- nginx.tmpl | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index 2270937..55f33ca 100644 --- a/Dockerfile +++ b/Dockerfile @@ -20,8 +20,8 @@ ADD . /app RUN wget -P /usr/local/bin https://godist.herokuapp.com/projects/ddollar/forego/releases/current/linux-amd64/forego RUN chmod u+x /usr/local/bin/forego -RUN wget https://github.com/jwilder/docker-gen/releases/download/0.2.1/docker-gen-linux-amd64-0.2.1.tar.gz -RUN tar xvzf docker-gen-linux-amd64-0.2.1.tar.gz +RUN wget https://github.com/jwilder/docker-gen/releases/download/0.3.0/docker-gen-linux-amd64-0.3.0.tar.gz +RUN tar xvzf docker-gen-linux-amd64-0.3.0.tar.gz EXPOSE 80 ENV DOCKER_HOST unix:///tmp/docker.sock diff --git a/nginx.tmpl b/nginx.tmpl index d8bd704..2f1eac4 100644 --- a/nginx.tmpl +++ b/nginx.tmpl @@ -6,7 +6,7 @@ server { return 503; } -{{ range $host, $containers := groupBy $ "Env.VIRTUAL_HOST" }} +{{ range $host, $containers := groupByMulti $ "Env.VIRTUAL_HOST" "," }} upstream {{ $host }} { {{ range $index, $value := $containers }}