thedocks/pihole/docker-compose.yml

40 lines
1.3 KiB
YAML
Raw Normal View History

2021-11-14 12:00:12 +00:00
# pihole
# https://blog.ivansmirnov.name/set-up-pihole-using-docker-macvlan-network/
version: '2'
2021-11-12 23:14:52 +00:00
services:
pihole:
2021-11-14 12:00:12 +00:00
container_name: pihole-vlan
image: pihole/pihole:2021.10.1 # check the latest version on docker hub.
hostname: pihole # set an easy hostname to remember
domainname: local # your local domain name
mac_address: de:ad:be:ef:ff:01 # can change or leave this
2021-11-12 23:14:52 +00:00
cap_add:
- NET_ADMIN
2021-11-14 12:00:12 +00:00
networks:
macvlan0: # same as network specified below
ipv4_address: 192.168.1.59 # the IP of the pihole container
dns:
- 127.0.0.1 # use local DNS, since the pihole
- 1.1.1.1 # optional fallback DNS
ports: # expose all pihole ports.
- 443/tcp
- 53/tcp
- 53/udp
- 67/udp
- 80/tcp
volumes: # mount our data volumes.
- './etc-pihole/:/etc/pihole/'
- './etc-dnsmasq.d/:/etc/dnsmasq.d/'
environment: # set variables for pihole configuration.
ServerIP: 192.168.1.59 # must match ipv4_address above
VIRTUAL_HOST: pihole.local # Must be hostname + domainname from above
WEBPASSWORD: ""
TZ: 'Europe/London' # pick your timezone
restart: unless-stopped
networks:
macvlan0: # externally created network (later in article)
external: true