Since commit 658e20f, the template makes the assumption that the container running docker-gen is the container running nginx while checking that upstream containers are reachable.
By introducint the `NGINX_CONTAINER` environment variable, users are now able to indicate which container is actually running nginx when running docker-gen and nginx in separated containers.
25 lines
595 B
YAML
25 lines
595 B
YAML
version: '2'
|
|
services:
|
|
nginx:
|
|
image: nginx
|
|
container_name: nginx
|
|
ports:
|
|
- "80:80"
|
|
volumes:
|
|
- /etc/nginx/conf.d
|
|
|
|
dockergen:
|
|
image: jwilder/docker-gen
|
|
command: -notify-sighup nginx -only-exposed -watch /etc/docker-gen/templates/nginx.tmpl /etc/nginx/conf.d/default.conf
|
|
volumes_from:
|
|
- nginx
|
|
volumes:
|
|
- /var/run/docker.sock:/tmp/docker.sock:ro
|
|
- ./nginx.tmpl:/etc/docker-gen/templates/nginx.tmpl
|
|
environment:
|
|
- NGINX_CONTAINER=nginx
|
|
|
|
whoami:
|
|
image: jwilder/whoami
|
|
environment:
|
|
- VIRTUAL_HOST=whoami.local
|