template.yaml 2.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. ---
  2. kind: compose
  3. schema: "1.1"
  4. metadata:
  5. name: Pihole
  6. description: >
  7. Network-wide advertisement and internet tracker blocking application that functions as a DNS sinkhole.
  8. Provides DNS-level content filtering for all network devices, improving browsing performance, privacy, and security.
  9. Supports custom blocklists, whitelists, and seamless integration with existing network infrastructure.
  10. Project: https://pi-hole.net/
  11. Documentation: https://docs.pi-hole.net/
  12. GitHub: https://github.com/pi-hole/pi-hole
  13. version: 2025.08.0
  14. author: Christian Lempa
  15. date: '2025-09-28'
  16. tags:
  17. - dns
  18. - ad-blocking
  19. draft: false
  20. next_steps: |
  21. 1. Start: docker compose up -d
  22. 2. Access web interface:
  23. {% if network_enabled and network_mode == 'macvlan' -%}
  24. http://{{ network_macvlan_ipv4_address }}
  25. {% elif traefik_enabled -%}
  26. {% if traefik_tls_enabled %}https{% else %}http{% endif %}://{{ traefik_host }}
  27. {%- elif ports_enabled -%}
  28. http://localhost:{{ ports_http }}/admin/login
  29. {%- endif %}
  30. 3. Login password: {{ pihole_webpassword }}
  31. (stored in .env.pihole file)
  32. {% if network_enabled and network_mode == 'macvlan' -%}
  33. 4. Configure devices to use {{ network_macvlan_ipv4_address }} as DNS server
  34. {% if dhcp_enabled %}Configure DHCP in Settings > DHCP{% endif %}
  35. {%- elif ports_enabled and dns_enabled -%}
  36. 4. Configure devices to use Docker host IP as DNS server (port 53)
  37. {% if dhcp_enabled %}Configure DHCP in Settings > DHCP (port 67){% endif %}
  38. {%- endif %}
  39. spec:
  40. general:
  41. vars:
  42. service_name:
  43. default: "pihole"
  44. container_name:
  45. default: "pihole"
  46. pihole:
  47. required: true
  48. vars:
  49. pihole_webpassword:
  50. description: "Web interface admin password"
  51. type: str
  52. sensitive: true
  53. default: ""
  54. autogenerated: true
  55. pihole_dns_upstreams:
  56. description: "Upstream DNS servers"
  57. type: str
  58. default: "1.1.1.1;1.0.0.1"
  59. extra: "Separate multiple DNS servers with semicolons (;)"
  60. dns_enabled:
  61. type: bool
  62. description: "Enable DNS server functionality"
  63. default: true
  64. extra: "Exposes port 53 for DNS queries in bridge network mode"
  65. dhcp_enabled:
  66. type: bool
  67. needs: "network_mode=host,macvlan"
  68. description: "Enable DHCP server functionality (requires host or macvlan network mode)"
  69. default: true
  70. traefik:
  71. vars:
  72. traefik_host:
  73. default: "pihole.home.arpa"
  74. network:
  75. required: true
  76. vars:
  77. network_name:
  78. default: "pihole_network"
  79. network_external:
  80. default: false
  81. ports:
  82. needs: "network_mode=bridge"
  83. vars:
  84. ports_https:
  85. description: "HTTPS port for web interface"
  86. type: int
  87. default: 8443
  88. extra: "Only used if Traefik is not enabled"