Support multiple VIRTUAL_HOSTs per container.

Fixes #3
This commit is contained in:
Jason Wilder 2014-06-08 10:14:51 -06:00
parent ebce30e761
commit b9d7bde5cd
2 changed files with 3 additions and 3 deletions

View file

@ -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

View file

@ -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 }}