Skip to content

Commit

Permalink
fix: ServerIP env variable deprecated, and other docker-compose.yaml …
Browse files Browse the repository at this point in the history
…updates (#109)

* updates to docker-compose.yaml and readme

* fixed typos

* final readme updates

* typo

* readme order

Co-authored-by: SSinSD <[email protected]>
  • Loading branch information
ChevySSinSD and ChevySSinSD authored Mar 11, 2022
1 parent 5969c76 commit 0c87b09
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 19 deletions.
32 changes: 17 additions & 15 deletions one-container/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,33 +2,33 @@

## Description

This Docker deployment runs both Pi-Hole and Unbound in a single container.
This Docker deployment runs both Pi-Hole and Unbound in a single container.

The base image for the container is the [official Pi-Hole container](https://hub.docker.com/r/pihole/pihole), with an extra build step added to install the Unbound resolver directly into to the container based on [instructions provided directly by the Pi-Hole team](https://docs.pi-hole.net/guides/unbound/).

## Usage

First create a `.env` file to substitute variables for your deployment.
First create a `.env` file to substitute variables for your deployment.

### Pi-hole environment variables

### Required environment variables
> Vars and descriptions replicated from the [official pihole container](https://github.com/pi-hole/docker-pi-hole/#environment-variables):
> Vars and descriptions replicated from the [official pihole container](https://github.com/pi-hole/docker-pi-hole/):
| Docker Environment Var | Description|
| --- | --- |
| `ServerIP: <Host's IP>`<br/> | **--net=host mode requires** Set to your server's LAN IP, used by web block modes and lighttpd bind address
| `TZ: <Timezone>`<br/> | Set your [timezone](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones) to make sure logs rotate at local midnight instead of at UTC midnight.
| `WEBPASSWORD: <Admin password>`<br/> | http://pi.hole/admin password. Run `docker logs pihole \| grep random` to find your random pass.
| `REV_SERVER: <"true"\|"false">`<br/> | Enable DNS conditional forwarding for device name resolution
| `REV_SERVER_DOMAIN: <Network Domain>`<br/> | If conditional forwarding is enabled, set the domain of the local network router
| `REV_SERVER_TARGET: <Router's IP>`<br/> | If conditional forwarding is enabled, set the IP of the local network router
| `REV_SERVER_CIDR: <Reverse DNS>`<br/>| If conditional forwarding is enabled, set the reverse DNS zone (e.g. `192.168.0.0/24`)
| Variable | Default | Value | Description |
| -------- | ------- | ----- | ---------- |
| `TZ` | UTC | `<Timezone>` | Set your [timezone](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones) to make sure logs rotate at local midnight instead of at UTC midnight.
| `WEBPASSWORD` | random | `<Admin password>` | http://pi.hole/admin password. Run `docker logs pihole \| grep random` to find your random pass.
| `FTLCONF_REPLY_ADDR4` | unset | `<Host's IP>` | Set to your server's LAN IP, used by web block modes and lighttpd bind address.
| `REV_SERVER` | `false` | `<"true"\|"false">` | Enable DNS conditional forwarding for device name resolution |
| `REV_SERVER_DOMAIN` | unset | Network Domain | If conditional forwarding is enabled, set the domain of the local network router |
| `REV_SERVER_TARGET` | unset | Router's IP | If conditional forwarding is enabled, set the IP of the local network router |
| `REV_SERVER_CIDR` | unset | Reverse DNS | If conditional forwarding is enabled, set the reverse DNS zone (e.g. `192.168.0.0/24`) |
| `WEBTHEME` | `default-light` | `<"default-dark"\|"default-darker"\|"default-light"\|"default-auto"\|"lcars">`| User interface theme to use.

Example `.env` file in the same directory as your `docker-compose.yaml` file:

```
ServerIP=192.168.1.10
FTLCONF_REPLY_ADDR4=192.168.1.10
TZ=America/Los_Angeles
WEBPASSWORD=QWERTY123456asdfASDF
REV_SERVER=true
Expand All @@ -37,6 +37,8 @@ REV_SERVER_TARGET=192.168.1.1
REV_SERVER_CIDR=192.168.0.0/16
HOSTNAME=pihole
DOMAIN_NAME=pihole.local
PIHOLE_WEBPORT=80
WEBTHEME=default-light
```

### Using Portainer stacks?
Expand Down
7 changes: 4 additions & 3 deletions one-container/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,21 +14,22 @@ services:
- 443:443/tcp
- 53:53/tcp
- 53:53/udp
- 80:80/tcp
- ${PIHOLE_WEBPORT}:80/tcp #Allows use of different port to access pihole web interface when other docker containers use port 80
# - 5335:5335/tcp # Uncomment to enable unbound access on local server
# - 22/tcp # Uncomment to enable SSH
environment:
- ServerIP=${ServerIP}
- FTLCONF_REPLY_ADDR4=${FTLCONF_REPLY_ADDR4}
- TZ=${TZ}
- WEBPASSWORD=${WEBPASSWORD}
- WEBTHEME=${WEBTHEME}
- REV_SERVER=${REV_SERVER}
- REV_SERVER_TARGET=${REV_SERVER_TARGET}
- REV_SERVER_DOMAIN=${REV_SERVER_DOMAIN}
- REV_SERVER_CIDR=${REV_SERVER_CIDR}
- PIHOLE_DNS_=127.0.0.1#5335
- DNSSEC="true"
- DNSMASQ_LISTENING=single
volumes:
- etc_pihole-unbound:/etc/pihole:rw
- etc_pihole_dnsmasq-unbound:/etc/dnsmasq.d:rw
restart: unless-stopped

2 changes: 1 addition & 1 deletion two-container/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ services:
- 80/tcp
- 22/tcp
environment:
- ServerIP=192.168.1.5
- FTLCONF_REPLY_ADDR4=192.168.1.5
- WEBPASSWORD=${WEBPASSWORD}
- PIHOLE_DNS_192.168.1.6;192.168.1.13
volumes:
Expand Down

0 comments on commit 0c87b09

Please sign in to comment.