Compose v3: Moved shared volume to top-level volumes entry
For compatibility for Docker Compose v3, replaced the unnamed volume in the nginx service with a named nginx_conf volume that is shared by both services.
This commit is contained in:
parent
b9e2053c38
commit
b680816505
1 changed files with 6 additions and 4 deletions
|
|
@ -1,4 +1,4 @@
|
|||
version: '2'
|
||||
version: '3'
|
||||
services:
|
||||
nginx:
|
||||
image: nginx
|
||||
|
|
@ -6,18 +6,20 @@ services:
|
|||
ports:
|
||||
- "80:80"
|
||||
volumes:
|
||||
- /etc/nginx/conf.d
|
||||
- nginx_conf:/etc/nginx/conf.d
|
||||
|
||||
dockergen:
|
||||
image: jwilder/docker-gen
|
||||
command: -notify-sighup nginx -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
|
||||
- nginx_conf:/etc/nginx/conf.d
|
||||
|
||||
whoami:
|
||||
image: jwilder/whoami
|
||||
environment:
|
||||
- VIRTUAL_HOST=whoami.local
|
||||
|
||||
volumes:
|
||||
nginx_conf: {}
|
||||
|
|
|
|||
Loading…
Reference in a new issue