variabilized more values, reorganized values in env.example file

This commit is contained in:
Bryan Joshua Pedini 2022-01-22 23:27:55 +01:00
parent 39dbe048f5
commit 4d4a578b78
2 changed files with 14 additions and 10 deletions

View File

@ -12,11 +12,11 @@ services:
# enable Træfik dashboard
- --api.dashboard=true
# configure Let's Encrypt automatic certificates
- --certificatesresolvers.letsencrypt.acme.dnschallenge=true
- --certificatesresolvers.letsencrypt.acme.dnschallenge.provider=hetzner
- --certificatesresolvers.letsencrypt.acme.email=${LETSENCRYPT_EMAIL}
- --certificatesresolvers.letsencrypt.acme.keytype=RSA4096
- --certificatesresolvers.letsencrypt.acme.storage=/certs.json
- --certificatesresolvers.${TRAEFIK_CERTRESOLVER}.acme.dnschallenge=true
- --certificatesresolvers.${TRAEFIK_CERTRESOLVER}.acme.dnschallenge.provider=hetzner
- --certificatesresolvers.${TRAEFIK_CERTRESOLVER}.acme.email=${LETSENCRYPT_EMAIL}
- --certificatesresolvers.${TRAEFIK_CERTRESOLVER}.acme.keytype=RSA4096
- --certificatesresolvers.${TRAEFIK_CERTRESOLVER}.acme.storage=/certs.json
# we listen on both HTTP and HTTPS
- --entrypoints.http.address=:80
- --entrypoints.https.address=:443
@ -36,7 +36,7 @@ services:
- HETZNER_API_KEY=${HETZNER_API_KEY}
labels:
# expose Træfik using Træfik (dashboard)
- traefik.enable=true
- traefik.enable=${TRAEFIK_ENABLED}
# configure a global whitelist for my home
- traefik.http.middlewares.dashboard-whitelist.ipwhitelist.sourcerange=${TRAEFIK_DASHBOARD_WHITELIST}
# configure the global redirect middleware
@ -58,8 +58,8 @@ services:
- traefik.http.routers.https-${TRAEFIK_ROUTER}.rule=Host(`${TRAEFIK_MATCHRULE}`)
- traefik.http.routers.https-${TRAEFIK_ROUTER}.service=api@internal
# 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
- traefik.http.routers.https-${TRAEFIK_ROUTER}.tls=${TRAEFIK_TLSENABLED}
- traefik.http.routers.https-${TRAEFIK_ROUTER}.tls.certresolver=${TRAEFIK_CERTRESOLVER}
networks:
- traefik
ports:

View File

@ -1,10 +1,14 @@
# General environment
TRAEFIK_VERSION=2.4
TRAEFIK_CERTRESOLVER=letsencrypt
TRAEFIK_CONTAINER_NAME=traefik.mydomain.com
TRAEFIK_DASHBOARD_WHITELIST=1.2.3.4/24
TRAEFIK_ENABLED=true
TRAEFIK_NETWORK=traefik
TRAEFIK_MATCHRULE=traefik.mydomain.com
TRAEFIK_ROUTER=traefik_mydomain_com
TRAEFIK_NETWORK=traefik-proxy
TRAEFIK_PILOT_TOKEN=
TRAEFIK_DASHBOARD_WHITELIST=1.2.3.4/24
TRAEFIK_TLSENABLED=true
# Certificate provider
HETZNER_API_KEY=