Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save candoom/62d866eafdec849a9fdb1aee6e07bfb8 to your computer and use it in GitHub Desktop.
Save candoom/62d866eafdec849a9fdb1aee6e07bfb8 to your computer and use it in GitHub Desktop.
Create 2 docker containers with pihole in the Container-Station on a QNAP NAS
An example to create 2 docker containers with pihole in the Container-Station on a QNAP NAS
Details about the environment variables in the pihole docker image can be found here:
https://github.com/pi-hole/docker-pi-hole#environment-variables
Details about the qnet network driver can be found here:
https://qnap-dev.github.io/container-station-api/qnet.html#docker-compose
version: '2'
services:
pihole-01:
image: pihole/pihole:latest
# so we can make an IP assignment in DHCP, we set a fixed MAC address
mac_address: 01:02:03:04:05:06
environment:
# setting a timezone
TZ: "Europe/Berlin"
# setting a password
WEBPASSWORD: "password"
# setting of 2 secure, censorship-free and non-logging DNS servers
DNS1: "46.182.19.48"
DNS2: "194.150.168.168"
# The feature "Conditional forwarding" is set and configured
CONDITIONAL_FORWARDING: "true"
CONDITIONAL_FORWARDING_IP: "192.168.1.1"
CONDITIONAL_FORWARDING_DOMAIN: "lan"
# we set an virtual host so we can reach the admin panel via the hostname
VIRTUAL_HOST: "docker-pihole-01.lan"
volumes:
# set two mount points to store the configuration in separate folders on the NAS
- /share/Docker/docker-pihole-01/etc-pihole:/etc/pihole
- /share/Docker/docker-pihole-01/etc-dnsmasq.d:/etc/dnsmasq.d
networks:
# assign the container to the qnet-DHCP-network
- qnet-dhcp
restart: unless-stopped
pihole-02:
image: pihole/pihole:latest
# so we can make an IP assignment in DHCP, we set a fixed MAC address
mac_address: 07:08:09:0a:0b:0c
environment:
# setting your timezone
TZ: "Europe/Berlin"
# setting a password
WEBPASSWORD: "password"
# setting of 2 secure, censorship-free and non-logging DNS servers
DNS1: "46.182.19.48"
DNS2: "194.150.168.168"
# The feature "Conditional forwarding" is set and configured
CONDITIONAL_FORWARDING: "true"
CONDITIONAL_FORWARDING_IP: "192.168.1.1"
CONDITIONAL_FORWARDING_DOMAIN: "lan"
# we set an virtual host so we can reach the admin panel via the hostname
VIRTUAL_HOST: "docker-pihole-02.lan"
volumes:
# set two mount points to store the configuration in separate folders on the NAS
- /share/Docker/docker-pihole-02/etc-pihole:/etc/pihole
- /share/Docker/docker-pihole-02/etc-dnsmasq.d:/etc/dnsmasq.d
networks:
# assign the container to the qnet-DHCP-network
- qnet-dhcp
restart: unless-stopped
# here the network driver is configured.
networks:
qnet-dhcp:
driver: qnet
ipam:
driver: qnet
options:
iface: "eth0"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment