update
This commit is contained in:
@@ -0,0 +1,2 @@
|
||||
# Pi-hole credentials
|
||||
WEBPASSWORD=<< webpassword >>
|
||||
@@ -0,0 +1,129 @@
|
||||
---
|
||||
services:
|
||||
<< service_name >>:
|
||||
image: docker.io/pihole/pihole:2026.04.1
|
||||
|
||||
restart: << restart_policy >>
|
||||
<%- if container_name %>
|
||||
container_name: << container_name >>
|
||||
<%- endif %>
|
||||
|
||||
<%- if container_hostname %>
|
||||
hostname: << container_hostname >>
|
||||
<%- endif %>
|
||||
|
||||
environment:
|
||||
- TZ=<< container_timezone >>
|
||||
- PIHOLE_UID=<< user_uid >>
|
||||
- PIHOLE_GID=<< user_gid >>
|
||||
- FTLCONF_webserver_api_password=${WEBPASSWORD}
|
||||
<%- if network_mode == 'bridge' %>
|
||||
- FTLCONF_dns_listeningMode=all
|
||||
<%- endif %>
|
||||
|
||||
<%- if network_mode == 'host' %>
|
||||
network_mode: host
|
||||
<%- elif network_mode == 'bridge' or network_mode == 'macvlan' or traefik_enabled %>
|
||||
networks:
|
||||
<%- if traefik_enabled %>
|
||||
<< traefik_network >>:
|
||||
<%- endif %>
|
||||
<%- if network_mode == 'macvlan' %>
|
||||
<< network_name >>:
|
||||
ipv4_address: << network_macvlan_ipv4_address >>
|
||||
<%- elif network_mode == 'bridge' %>
|
||||
<< network_name >>:
|
||||
<%- endif %>
|
||||
<%- endif %>
|
||||
|
||||
<%- if network_mode == '' or network_mode == 'bridge' or traefik_enabled %>
|
||||
ports:
|
||||
<%- if not traefik_enabled %>
|
||||
- "<< ports_http >>:80/tcp"
|
||||
- "<< ports_https >>:443/tcp"
|
||||
<%- endif %>
|
||||
- "<< ports_dns >>:53/tcp"
|
||||
- "<< ports_dns >>:53/udp"
|
||||
- "<< ports_ntp >>:123/udp"
|
||||
<%- endif %>
|
||||
|
||||
volumes:
|
||||
<%- if volume_mode == 'mount' %>
|
||||
- << volume_mount_path >>/dnsmasq:/etc/dnsmasq.d:rw
|
||||
- << volume_mount_path >>/pihole:/etc/pihole:rw
|
||||
<%- else %>
|
||||
- << service_name >>-dnsmasq:/etc/dnsmasq.d
|
||||
- << service_name >>-pihole:/etc/pihole
|
||||
<%- endif %>
|
||||
|
||||
cap_add:
|
||||
- NET_ADMIN
|
||||
- SYS_TIME
|
||||
|
||||
<%- if traefik_enabled %>
|
||||
labels:
|
||||
- traefik.enable=true
|
||||
- traefik.docker.network=<< traefik_network >>
|
||||
- traefik.http.services.<< service_name >>-web.loadBalancer.server.port=80
|
||||
- traefik.http.routers.<< service_name >>-http.service=<< service_name >>-web
|
||||
- traefik.http.routers.<< service_name >>-http.rule=Host(`<< traefik_host >>.<< traefik_domain >>`)
|
||||
- traefik.http.routers.<< service_name >>-http.entrypoints=<< traefik_entrypoint >>
|
||||
<%- if traefik_tls_enabled %>
|
||||
- traefik.http.routers.<< service_name >>-https.service=<< service_name >>-web
|
||||
- traefik.http.routers.<< service_name >>-https.rule=Host(`<< traefik_host >>.<< traefik_domain >>`)
|
||||
- traefik.http.routers.<< service_name >>-https.entrypoints=<< traefik_tls_entrypoint >>
|
||||
- traefik.http.routers.<< service_name >>-https.tls=true
|
||||
- traefik.http.routers.<< service_name >>-https.tls.certresolver=<< traefik_tls_certresolver >>
|
||||
<%- endif %>
|
||||
<%- endif %>
|
||||
|
||||
|
||||
<%- if volume_mode == 'local' %>
|
||||
volumes:
|
||||
<< service_name >>-dnsmasq:
|
||||
driver: local
|
||||
<< service_name >>-pihole:
|
||||
driver: local
|
||||
<%- elif volume_mode == 'nfs' %>
|
||||
volumes:
|
||||
<< service_name >>-dnsmasq:
|
||||
driver: local
|
||||
driver_opts:
|
||||
type: nfs
|
||||
o: addr=<< volume_nfs_server >>,<< volume_nfs_options >>
|
||||
device: ":<< volume_nfs_path >>/dnsmasq"
|
||||
<< service_name >>-pihole:
|
||||
driver: local
|
||||
driver_opts:
|
||||
type: nfs
|
||||
o: addr=<< volume_nfs_server >>,<< volume_nfs_options >>
|
||||
device: ":<< volume_nfs_path >>/pihole"
|
||||
<%- endif %>
|
||||
|
||||
|
||||
<%- if network_mode == 'bridge' or network_mode == 'macvlan' or traefik_enabled %>
|
||||
networks:
|
||||
<%- if network_mode == 'bridge' or network_mode == 'macvlan' %>
|
||||
<< network_name >>:
|
||||
<%- if network_external %>
|
||||
external: true
|
||||
<%- else %>
|
||||
<%- if network_mode == 'macvlan' %>
|
||||
driver: macvlan
|
||||
driver_opts:
|
||||
parent: << network_macvlan_parent_interface >>
|
||||
ipam:
|
||||
config:
|
||||
- subnet: << network_macvlan_subnet >>
|
||||
gateway: << network_macvlan_gateway >>
|
||||
name: << network_name >>
|
||||
<%- else %>
|
||||
driver: bridge
|
||||
<%- endif %>
|
||||
<%- endif %>
|
||||
<%- endif %>
|
||||
<%- if traefik_enabled %>
|
||||
<< traefik_network >>:
|
||||
external: true
|
||||
<%- endif %>
|
||||
<%- endif %>
|
||||
@@ -0,0 +1,402 @@
|
||||
{
|
||||
"slug": "pihole",
|
||||
"kind": "compose",
|
||||
"metadata": {
|
||||
"name": "Pihole",
|
||||
"description": "Network-wide DNS-based ad and tracker blocker that acts as a DNS sinkhole. Filters content at the DNS level for all devices on your network.",
|
||||
"tags": [
|
||||
"traefik",
|
||||
"network",
|
||||
"volume"
|
||||
],
|
||||
"icon": {
|
||||
"provider": "selfhst",
|
||||
"id": "pi-hole"
|
||||
},
|
||||
"draft": false,
|
||||
"version": {
|
||||
"name": "2026.04.1",
|
||||
"source_dep_name": "docker.io/pihole/pihole",
|
||||
"source_dep_version": "2026.04.1"
|
||||
}
|
||||
},
|
||||
"variables": [
|
||||
{
|
||||
"title": "General",
|
||||
"name": "general",
|
||||
"items": [
|
||||
{
|
||||
"name": "service_name",
|
||||
"type": "str",
|
||||
"title": "Service Name",
|
||||
"required": false,
|
||||
"default": "pihole",
|
||||
"config": {
|
||||
"placeholder": "pihole"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "container_name",
|
||||
"type": "str",
|
||||
"title": "Container Name",
|
||||
"required": false,
|
||||
"default": "pihole",
|
||||
"config": {
|
||||
"placeholder": "pihole"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "container_hostname",
|
||||
"type": "str",
|
||||
"title": "Container Hostname",
|
||||
"required": false
|
||||
},
|
||||
{
|
||||
"name": "container_timezone",
|
||||
"type": "str",
|
||||
"title": "Container Timezone",
|
||||
"required": false,
|
||||
"config": {
|
||||
"placeholder": "Europe/Berlin"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "user_uid",
|
||||
"type": "int",
|
||||
"title": "User Uid",
|
||||
"required": false,
|
||||
"default": 1000,
|
||||
"config": {
|
||||
"placeholder": "1000"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "user_gid",
|
||||
"type": "int",
|
||||
"title": "User Gid",
|
||||
"required": false,
|
||||
"default": 1000,
|
||||
"config": {
|
||||
"placeholder": "1000"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "restart_policy",
|
||||
"type": "enum",
|
||||
"title": "Restart Policy",
|
||||
"required": true,
|
||||
"default": "unless-stopped",
|
||||
"config": {
|
||||
"options": [
|
||||
"unless-stopped",
|
||||
"always",
|
||||
"on-failure",
|
||||
"no"
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"title": "Admin Settings",
|
||||
"name": "admin-settings",
|
||||
"items": [
|
||||
{
|
||||
"name": "webpassword",
|
||||
"type": "secret",
|
||||
"title": "Admin Password",
|
||||
"required": false,
|
||||
"config": {
|
||||
"autogenerated": {
|
||||
"length": 32
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"title": "Ports",
|
||||
"name": "ports",
|
||||
"items": [
|
||||
{
|
||||
"name": "ports_dns",
|
||||
"type": "int",
|
||||
"title": "DNS Port",
|
||||
"required": true,
|
||||
"default": 53,
|
||||
"config": {
|
||||
"placeholder": "53"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "ports_http",
|
||||
"type": "int",
|
||||
"title": "HTTP Port",
|
||||
"required": false,
|
||||
"default": 80,
|
||||
"config": {
|
||||
"placeholder": "80"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "ports_https",
|
||||
"type": "int",
|
||||
"title": "HTTPS Port",
|
||||
"required": false,
|
||||
"default": 443,
|
||||
"config": {
|
||||
"placeholder": "443"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "ports_ntp",
|
||||
"type": "int",
|
||||
"title": "External NTP port",
|
||||
"required": true,
|
||||
"default": 123,
|
||||
"config": {
|
||||
"placeholder": "123"
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"title": "Traefik",
|
||||
"name": "traefik",
|
||||
"toggle": "traefik_enabled",
|
||||
"items": [
|
||||
{
|
||||
"name": "traefik_enabled",
|
||||
"type": "bool",
|
||||
"title": "Traefik",
|
||||
"required": false,
|
||||
"default": false
|
||||
},
|
||||
{
|
||||
"name": "traefik_host",
|
||||
"type": "str",
|
||||
"title": "Host",
|
||||
"required": true,
|
||||
"config": {
|
||||
"placeholder": "pihole"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "traefik_domain",
|
||||
"type": "str",
|
||||
"title": "Domain",
|
||||
"required": true,
|
||||
"config": {
|
||||
"placeholder": "home.arpa"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "traefik_entrypoint",
|
||||
"type": "str",
|
||||
"title": "Entrypoint",
|
||||
"required": true,
|
||||
"default": "web",
|
||||
"config": {
|
||||
"placeholder": "web"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "traefik_network",
|
||||
"type": "str",
|
||||
"title": "Network",
|
||||
"required": true,
|
||||
"default": "traefik",
|
||||
"config": {
|
||||
"placeholder": "traefik"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "traefik_tls_enabled",
|
||||
"type": "bool",
|
||||
"title": "TLS",
|
||||
"required": false,
|
||||
"default": false
|
||||
},
|
||||
{
|
||||
"name": "traefik_tls_entrypoint",
|
||||
"type": "str",
|
||||
"title": "TLS Entrypoint",
|
||||
"required": true,
|
||||
"default": "websecure",
|
||||
"config": {
|
||||
"placeholder": "websecure"
|
||||
},
|
||||
"needs": [
|
||||
"traefik_tls_enabled=true"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "traefik_tls_certresolver",
|
||||
"type": "str",
|
||||
"title": "Cert Resolver",
|
||||
"required": true,
|
||||
"default": "cloudflare",
|
||||
"config": {
|
||||
"placeholder": "cloudflare"
|
||||
},
|
||||
"needs": [
|
||||
"traefik_tls_enabled=true"
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"title": "Network",
|
||||
"name": "network",
|
||||
"items": [
|
||||
{
|
||||
"name": "network_mode",
|
||||
"type": "str",
|
||||
"title": "Network Mode",
|
||||
"required": false
|
||||
},
|
||||
{
|
||||
"name": "network_name",
|
||||
"type": "str",
|
||||
"title": "Network Name",
|
||||
"required": false,
|
||||
"default": "pihole_network",
|
||||
"config": {
|
||||
"placeholder": "pihole_network"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "network_macvlan_ipv4_address",
|
||||
"type": "str",
|
||||
"title": "IPv4 Address",
|
||||
"required": true,
|
||||
"default": "IP_ADDRESS",
|
||||
"needs": [
|
||||
"network_mode=macvlan"
|
||||
],
|
||||
"config": {
|
||||
"placeholder": "IP_ADDRESS"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "network_macvlan_parent_interface",
|
||||
"type": "str",
|
||||
"title": "Parent Interface",
|
||||
"required": true,
|
||||
"default": "eth0",
|
||||
"needs": [
|
||||
"network_mode=macvlan"
|
||||
],
|
||||
"config": {
|
||||
"placeholder": "eth0"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "network_macvlan_subnet",
|
||||
"type": "str",
|
||||
"title": "Subnet",
|
||||
"required": true,
|
||||
"default": "IP_RANGE",
|
||||
"needs": [
|
||||
"network_mode=macvlan"
|
||||
],
|
||||
"config": {
|
||||
"placeholder": "IP_RANGE"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "network_macvlan_gateway",
|
||||
"type": "str",
|
||||
"title": "Gateway",
|
||||
"required": true,
|
||||
"default": "GATEWAY",
|
||||
"needs": [
|
||||
"network_mode=macvlan"
|
||||
],
|
||||
"config": {
|
||||
"placeholder": "GATEWAY"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "network_external",
|
||||
"type": "bool",
|
||||
"title": "External Network",
|
||||
"required": false,
|
||||
"default": false
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"title": "Volume",
|
||||
"name": "volume",
|
||||
"items": [
|
||||
{
|
||||
"name": "volume_mode",
|
||||
"type": "enum",
|
||||
"title": "Volume Mode",
|
||||
"required": true,
|
||||
"default": "local",
|
||||
"config": {
|
||||
"options": [
|
||||
"local",
|
||||
"mount",
|
||||
"nfs"
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "volume_mount_path",
|
||||
"type": "str",
|
||||
"title": "Volume Mount Path",
|
||||
"required": true,
|
||||
"default": "/data",
|
||||
"needs": [
|
||||
"volume_mode=mount"
|
||||
],
|
||||
"config": {
|
||||
"placeholder": "/data"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "volume_nfs_server",
|
||||
"type": "str",
|
||||
"title": "Volume Nfs Server",
|
||||
"required": true,
|
||||
"default": "NFS_SERVER",
|
||||
"needs": [
|
||||
"volume_mode=nfs"
|
||||
],
|
||||
"config": {
|
||||
"placeholder": "NFS_SERVER"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "volume_nfs_path",
|
||||
"type": "str",
|
||||
"title": "Volume Nfs Path",
|
||||
"required": true,
|
||||
"default": "/export",
|
||||
"needs": [
|
||||
"volume_mode=nfs"
|
||||
],
|
||||
"config": {
|
||||
"placeholder": "/export"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "volume_nfs_options",
|
||||
"type": "str",
|
||||
"title": "Volume Nfs Options",
|
||||
"required": true,
|
||||
"default": "rw,nolock,soft",
|
||||
"needs": [
|
||||
"volume_mode=nfs"
|
||||
],
|
||||
"config": {
|
||||
"placeholder": "rw,nolock,soft"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
Reference in New Issue
Block a user