1
0
mirror of https://github.com/pi-hole/docker-pi-hole.git synced 2024-06-20 14:36:39 +02:00

adding another docker compose example based off my setup, making sure doco examples are all using the latest environment variable for piholeIP (host ip)

This commit is contained in:
diginc 2016-03-28 21:42:11 -05:00
parent 831477dda0
commit e9412e7190
5 changed files with 40 additions and 4 deletions

View File

@ -14,7 +14,7 @@ This version of the docker aims to be as close to a standard pi-hole installatio
## Basic Docker Usage
If you have no other dockers using port 80, the minimum options required to run this container are in the script [docker_run.sh](https://github.com/diginc/docker-pi-hole/blob/master/docker_run.sh):
If you have no other dockers using port 80 (if you do, read the list below for reverse proxy advice), the minimum options required to run this container are in the script [docker_run.sh](https://github.com/diginc/docker-pi-hole/blob/master/docker_run.sh):
```
IP=$(ip addr show eth0 | grep "inet\b" | awk '{print $2}' | cut -d/ -f1)
@ -23,7 +23,7 @@ docker run -p 53:53/tcp -p 53:53/udp -p 80:80 --cap-add=NET_ADMIN -e piholeIP="$
* piholeIP environment variable is required or default pi-hole scripts autodetect and give ads the private docker ip address that is not on your network so won't work.
* A good way to test things are working right is by loading this page: [http://pi-hole.isworking.ok/admin/](http://pi-hole.isworking.ok/admin/)
* I'm running jwilder/proxy on my port 80 already so I have `DEFAULT_HOST=pihole.mydomain.lan` (and matching VIRTUAL_HOST envs on the pihole) to ensure all the ad domains get served blank pages from my pihole container by default.
* [Here is an example of running with jwilder/proxy](https://github.com/diginc/docker-pi-hole/blob/master/jwilder-proxy-example-doco.yml) (an nginx auto-configuring docker reverse proxy for docker) on my port 80 with pihole on another porg. Pi-hole needs to be `DEFAULT_HOST` env in jwilder/proxy and you need to set the matching `VIRTUAL_HOST` for the pihole. Please read jwilder/proxy readme for more info if you have trouble. I tested this basic exmaple which is based off what I run.
* If you have something else taking up port 80 then the ads may not transform into blank ads correctly. The solution to this is to make sure whatever you do have as the 'default' port 80 virtual host is redirect to this container.
* dnsmasq requires NET_ADMIN capabilities to run correctly in docker.

View File

@ -3,7 +3,7 @@ alpine:
dockerfile: alpine.docker
environment:
# Your docker host IP is required
- piholeIP: 192.168.1.102
- piholeIP: 192.168.1.55
ports:
- "53:53/tcp"
- "53:53/udp"

View File

@ -3,7 +3,7 @@ debian:
dockerfile: debian.docker
environment:
# Your docker host IP is required
- piholeIP: 192.168.1.102
- piholeIP: 192.168.1.55
ports:
- "53:53/tcp"
- "53:53/udp"

View File

@ -14,6 +14,7 @@ pihole:
- NET_ADMIN
# docker jwilder/nginx-proxy support
environment:
piholeIP: 192.168.1.55
PROXY_LOCATION: pihole
VIRTUAL_HOST: pihole.yourdomain.local
VIRTUAL_PORT: 80

View File

@ -0,0 +1,35 @@
applist:
image: jwilder/nginx-proxy
ports:
- '80:80'
environment:
DEFAULT_HOST: pihole.yourDomain.lan
volumes:
- '/var/run/docker.sock:/tmp/docker.sock'
restart: always
pihole:
image: diginc/pi-hole:alpine
ports:
- '53:53/tcp'
- '53:53/udp'
- '8053:80/tcp'
volumes:
- '/var/log/pihole.log:/var/log/pihole.log'
#net: host
cap_add:
- NET_ADMIN
environment:
piholeIP: 192.168.41.55
PROXY_LOCATION: pihole
VIRTUAL_HOST: pihole.yourDomain.lan
VIRTUAL_PORT: 80
extra_hosts:
# Resolve to nothing domains (terminate connection)
- 'nw2master.bioware.com nwn2.master.gamespy.com:0.0.0.0'
# LAN hostnames for other docker containers using jwilder
- 'yourDomain.lan:192.168.41.55'
- 'pihole pihole.yourDomain.lan:192.168.41.55'
- 'ghost ghost.yourDomain.lan:192.168.41.55'
- 'wordpress wordpress.yourDomain.lan:192.168.41.55'
restart: always