version: "3.9" x-traefik-exporter-label: &traefik-exporter-label traefik.enable: true traefik.http.routers.nginx-exporter.service: nginx-exporter traefik.http.services.nginx-exporter.loadbalancer.server.port: 9113 services: nginx: image: nginx:1.29.0-alpine container_name: nginx privileged: true user: root network_mode: host volumes: - /volume5/storage/docker-data/nginx/conf/nginx.conf:/etc/nginx/nginx.conf - /volume5/storage/docker-data/nginx/conf/conf.d/:/etc/nginx/conf.d/ - /volume5/storage/docker-data/nginx/conf/snippets/:/etc/nginx/snippets/ - /volume5/storage/docker-data/nginx/conf/cert/:/etc/nginx/cert/ - /volume5/storage/docker-data/nginx/static/:/usr/share/nginx/static/ restart: always nginx-exporter: image: nginx/nginx-prometheus-exporter:1.4.2 container_name: nginx-exporter labels: <<: *traefik-exporter-label expose: - "9113" extra_hosts: - "host.docker.internal:host-gateway" command: --nginx.scrape-uri=http://host.docker.internal:80/stub_status restart: always