--- version: '3.9' services: {% if deploy_adguard_virtual_ip['enable'] %} keepalived: image: ghcr.io/rmartin16/keepalived:latest network_mode: host healthcheck: test: ["CMD-SHELL", "ip addr show dev {{ deploy_adguard_virtual_ip['interface'] }} | grep -q {{ deploy_adguard_virtual_ip['vip_addr'] }}"] interval: 10s timeout: 5s retries: 5 start_period: 30s environment: INTERFACE: {{ deploy_adguard_virtual_ip['interface'] }} VIRTUAL_IPS: {{ deploy_adguard_virtual_ip['vip_addr'] }} STATE: "BACKUP" cap_add: - NET_ADMIN {% endif %} adguard: image: adguard/adguardhome:latest {% if deploy_adguard_virtual_ip['enable']%} depends_on: keepalived: condition: service_healthy {% endif %} ports: - "{% if deploy_adguard_virtual_ip['enable'] %}{{ deploy_adguard_virtual_ip['vip_addr'] }}:{% endif %}53:53/tcp" - "{% if deploy_adguard_virtual_ip['enable'] %}{{ deploy_adguard_virtual_ip['vip_addr'] }}:{% endif %}53:53/udp" {% if deploy_adguard_enable_admin_interface %} - "{% if deploy_adguard_consul['enable'] %}127.0.0.1:{% endif %}80:80/tcp" - "{% if deploy_adguard_consul['enable'] %}127.0.0.1:{% endif %}443:443/tcp" - "3000:3000/tcp" {% endif %} {% if deploy_adguard_enable_dhcp %} - "{% if deploy_adguard_virtual_ip['enable'] %}{{ deploy_adguard_virtual_ip['vip_addr'] }}:{% endif %}67:67/udp" - "{% if deploy_adguard_virtual_ip['enable'] %}{{ deploy_adguard_virtual_ip['vip_addr'] }}:{% endif %}68:68/tcp" - "{% if deploy_adguard_virtual_ip['enable'] %}{{ deploy_adguard_virtual_ip['vip_addr'] }}:{% endif %}68:68/udp" {% endif %} {% if deploy_adguard_enable_doh %} - "{% if deploy_adguard_virtual_ip['enable'] %}{% endif %}443:443/udp" {% endif %} {% if deploy_adguard_enable_dot %} - "{% if deploy_adguard_virtual_ip['enable'] %}{% endif %}853:853/tcp" {% endif %} {% if deploy_adguard_enable_doq %} - "{% if deploy_adguard_virtual_ip['enable'] %}{{ deploy_adguard_virtual_ip['vip_addr'] }}:{% endif %}784:784/udp" - "{% if deploy_adguard_virtual_ip['enable'] %}{{ deploy_adguard_virtual_ip['vip_addr'] }}:{% endif %}8853:8853/udp" - "{% if deploy_adguard_virtual_ip['enable'] %}{{ deploy_adguard_virtual_ip['vip_addr'] }}:{% endif %}853:853/udp" {% endif %} {% if deploy_adguard_enable_dnscrypt %} - "{% if deploy_adguard_virtual_ip['enable'] %}{{ deploy_adguard_virtual_ip['vip_addr'] }}:{% endif %}5443:5443/tcp" - "{% if deploy_adguard_virtual_ip['enable'] %}{{ deploy_adguard_virtual_ip['vip_addr'] }}:{% endif %}5443:5443/udp" {% endif %} volumes: - conf:/opt/adguardhome/conf - data:/opt/adguardhome/work networks: - internal {% if deploy_adguard_node_exporter['enable'] %} node_exporter: image: ebrianne/adguard-exporter:latest depends_on: - adguard secrets: - adguard_passw environment: adguard_protocol: {{ deploy_adguard_node_exporter['protocol'] }} adguard_hostname: adguard adguard_username: {{ deploy_adguard_node_exporter['username'] }} adguard_password: /run/secrets/adguard_passw adguard_port: {{ deploy_adguard_node_exporter['port'] }} server_port: {{ deploy_adguard_node_exporter['exporter_port'] }} interval: {{ deploy_adguard_node_exporter['interval'] }} log_limit: {{ deploy_adguard_node_exporter['log_limit'] }} password_from_file: true ports: - "9617:9617" networks: - internal {% endif %} networks: internal: driver: bridge volumes: conf: driver_opts: o: bind device: {{ deploy_adguard_directory }}/conf type: none data: driver_opts: o: bind device: {{ deploy_adguard_directory }}/data type: none {% if deploy_adguard_node_exporter['enable'] %} secrets: adguard_passw: file: {{ deploy_adguard_directory }}/password {% endif %}