1
0
mirror of https://github.com/nginx-proxy/nginx-proxy synced 2025-11-13 04:32:07 +01:00
nginx-proxy/docker-compose-separate-containers.yml
Bob-le-pirate f2add3022b
docs: add precisions to multi container compose file (#2650)
Co-authored-by: Nicolas Duchon <nicolas.duchon@gmail.com>
2025-08-20 12:32:51 +02:00

29 lines
911 B
YAML

volumes:
nginx_conf:
services:
nginx:
image: nginx
container_name: nginx
ports:
- "80:80"
volumes:
- nginx_conf:/etc/nginx/conf.d:ro
- network_internal.conf:/etc/nginx/network_internal.conf:ro
dockergen:
image: nginxproxy/docker-gen
command: -notify-sighup nginx -watch /etc/docker-gen/templates/nginx.tmpl /etc/nginx/conf.d/default.conf
# the name "nginx" passed to the "-notify-sighup" flag must exactly match the container name used for the nginx container above.
environment:
# nginx-proxy environment variable (HTTP_PORT etc.) must be set on the docker-gen container (not the nginx container)
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.example