Guest User

Pihole docker-compose with MACVLAN

a guest
Mar 8th, 2025
207
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
YAML 2.37 KB | Source Code | 0 0
  1. services:
  2.   pihole:
  3.     container_name: pihole
  4.     image: pihole/pihole:latest
  5.     ports:
  6.      # DNS Ports
  7.       - "53:53/tcp"
  8.       - "53:53/udp"
  9.       # Default HTTP Port
  10.       - "80:80/tcp"
  11.       # Default HTTPs Port. FTL will generate a self-signed certificate
  12.       - "443:443/tcp"
  13.       # Uncomment the line below if you are using Pi-hole as your DHCP server
  14.       #- "67:67/udp"
  15.       # Uncomment the line below if you are using Pi-hole as your NTP server
  16.       #- "123:123/udp"
  17.     environment:
  18.      # Set the appropriate timezone for your location (https://en.wikipedia.org/wiki/List_of_tz_database_time_zones), e.g:
  19.       TZ: 'Europe/London'
  20.       # Set a password to access the web interface. Not setting one will result in a random password being assigned
  21.       FTLCONF_webserver_api_password: 'correct horse battery staple'
  22.       # If using Docker's default `bridge` network setting the dns listening mode should be set to 'all'
  23.       FTLCONF_dns_listeningMode: 'all'
  24.     # Volumes store your data between container upgrades
  25.     volumes:
  26.      # For persisting Pi-hole's databases and common configuration file
  27.       - './etc-pihole:/etc/pihole'
  28.       # Uncomment the below if you have custom dnsmasq config files that you want to persist. Not needed for most starting fresh with Pi-hole v6. If you're upgrading from v5 you and have used this directory before, you should keep it enabled for the first v6 container start to allow for a complete migration. It can be removed afterwards. Needs environment variable FTLCONF_misc_etc_dnsmasq_d: 'true'
  29.       #- './etc-dnsmasq.d:/etc/dnsmasq.d'
  30.     cap_add:
  31.      # See https://github.com/pi-hole/docker-pi-hole#note-on-capabilities
  32.       # Required if you are using Pi-hole as your DHCP server, else not needed
  33.       - NET_ADMIN
  34.       # Required if you are using Pi-hole as your NTP client to be able to set the host's system time
  35.       - SYS_TIME
  36.       # Optional, if Pi-hole should get some more processing time
  37.       - SYS_NICE
  38.     restart: unless-stopped
  39.     networks:
  40.           macvlan:
  41.             ipv4_address: 192.168.0.200
  42.  
  43. networks:
  44.   macvlan:
  45.     driver: macvlan
  46.     driver_opts:
  47.      # Change below to your physical interface (e.g. eth0, etc.) and append sub interface for VLAN ID if required
  48.       parent: eno1
  49.     ipam:
  50.       config:
  51.         - subnet: 192.168.0.0/24
  52.           gateway: 192.168.0.254
  53.  
Advertisement
Add Comment
Please, Sign In to add comment