version: '3.9'

services:
  adguard:
    image: adguard/adguardhome:v0.107.51
    volumes:
      - /export/adguard:/opt/adguardhome/conf
      - adguard_work:/opt/adguardhome/work
    ports:
      - target: 53
        published: 53
        protocol: tcp
        mode: host
      - target: 53
        published: 53
        protocol: udp
        mode: host
      - target: 3000
        published: 3000
        mode: host
    networks:
      - caddy-public
    deploy:
      placement:
        constraints:
          - "node.labels.role==db"
      replicas: 1

volumes:
  adguard_work:
    driver: local

networks:
  caddy-public:
    external: true
