added first deployment version

This commit is contained in:
Bryan Joshua Pedini 2022-01-09 14:00:23 +01:00
parent fb3a586b8e
commit d78bb3dc56
2 changed files with 48 additions and 0 deletions

39
docker-compose.yml Normal file
View File

@ -0,0 +1,39 @@
version: "3"
services:
pihole:
image: ${PH_IMAGE}
container_name: ${PH_CONTAINER_NAME}
restart: unless-stopped
environment:
- TZ: "${PH_TIMEZONE}"
- WEBPASSWORD: "${PH_WEPASSWORD}"
labels:
- traefik.enable=true
- traefik.docker.network=traefik-proxy
### Section HTTP
- traefik.http.routers.http-${TRAEFIK_ROUTER}.entrypoints=http
# redirect to HTTPS only
- traefik.http.routers.http-${TRAEFIK_ROUTER}.middlewares=http-to-https
- traefik.http.routers.http-${TRAEFIK_ROUTER}.rule=Host(`${TRAEFIK_MATCHRULE}`)
### Section HTTPS
- traefik.http.routers.https-${TRAEFIK_ROUTER}.entrypoints=https
# configure the exposed service
- traefik.http.routers.https-${TRAEFIK_ROUTER}.rule=Host(`${TRAEFIK_MATCHRULE}`)
# of course, enable TLS and it's certificate provider
- traefik.http.routers.https-${TRAEFIK_ROUTER}.tls=true
- traefik.http.routers.https-${TRAEFIK_ROUTER}.tls.certresolver=letsencrypt
# specify a service so a custom port can be used
- traefik.http.services.${TRAEFIK_SERVICE}.loadbalancer.server.port=${TRAEFIK_SERVICE_PORT}
ports:
- "53:53/tcp"
- "53:53/udp"
- "67:67/udp"
volumes:
- ./data/pihole:/etc/pihole/
- ./data/dnsmasq.d:/etc/dnsmasq.d/
networks:
traefik-proxy:
external: true
name: ${TRAEFIK_NETWORK}

9
env.example Normal file
View File

@ -0,0 +1,9 @@
PH_IMAGE=pihole/pihole:latest
PH_CONTAINER_NAME=pihole
PH_TIMEZONE=Europe/Rome
PH_WEBPASSWORD=admin
TRAEFIK_MATCHRULE=pihole.mydomain.com
TRAEFIK_ROUTER=pihole_mydomain_com
TRAEFIK_SERVICE=pihole_mydomain_com
TRAEFIK_SERVICE_PORT=80
TRAEFIK_NETWORK=traefik-proxy