renamed directories and environment variables

This commit is contained in:
Bryan Joshua Pedini 2022-01-15 22:39:35 +01:00
parent 46a8794a7c
commit 5b9facf603
2 changed files with 15 additions and 15 deletions

View File

@ -28,8 +28,8 @@ services:
# and we want to manually specify exposed containers # and we want to manually specify exposed containers
- --providers.docker.exposedbydefault=false - --providers.docker.exposedbydefault=false
- --providers.docker.watch=true - --providers.docker.watch=true
# should not need, but just in case, a dynamic config file is also configured # should not need, but just in case, a folder for dynamic config files is also configured
- --providers.file.directory=/dynamic-config - --providers.file.directory=/config
- --providers.file.watch=true - --providers.file.watch=true
environment: environment:
- HETZNER_API_KEY=${HETZNER_API_KEY} - HETZNER_API_KEY=${HETZNER_API_KEY}
@ -42,23 +42,23 @@ services:
- traefik.http.middlewares.http-to-https.redirectscheme.scheme=https - traefik.http.middlewares.http-to-https.redirectscheme.scheme=https
- traefik.http.middlewares.http-to-https.redirectscheme.permanent=true - traefik.http.middlewares.http-to-https.redirectscheme.permanent=true
### Section HTTP ### Section HTTP
- traefik.http.routers.http-${TRAEFIK_ROUTER_NAME}.entrypoints=http - traefik.http.routers.http-${TRAEFIK_ROUTER}.entrypoints=http
# only some people can access the dashboard, hence protect it with it's whitelist # only some people can access the dashboard, hence protect it with it's whitelist
- traefik.http.routers.http-${TRAEFIK_ROUTER_NAME}.middlewares=dashboard-whitelist - traefik.http.routers.http-${TRAEFIK_ROUTER}.middlewares=dashboard-whitelist
# redirect Træfik dashboard to HTTPS only # redirect Træfik dashboard to HTTPS only
- traefik.http.routers.http-${TRAEFIK_ROUTER_NAME}.middlewares=http-to-https - traefik.http.routers.http-${TRAEFIK_ROUTER}.middlewares=http-to-https
- traefik.http.routers.http-${TRAEFIK_ROUTER_NAME}.rule=Host(`${TRAEFIK_MATCHRULE}`) - traefik.http.routers.http-${TRAEFIK_ROUTER}.rule=Host(`${TRAEFIK_MATCHRULE}`)
- traefik.http.routers.http-${TRAEFIK_ROUTER_NAME}.service=api@internal - traefik.http.routers.http-${TRAEFIK_ROUTER}.service=api@internal
### Section HTTPS ### Section HTTPS
- traefik.http.routers.https-${TRAEFIK_ROUTER_NAME}.entrypoints=https - traefik.http.routers.https-${TRAEFIK_ROUTER}.entrypoints=https
# only some people can access the dashboard, hence protect it with it's whitelist # only some people can access the dashboard, hence protect it with it's whitelist
- traefik.http.routers.https-${TRAEFIK_ROUTER_NAME}.middlewares=dashboard-whitelist - traefik.http.routers.https-${TRAEFIK_ROUTER}.middlewares=dashboard-whitelist
# configure Træfik dashboard to be the exposed service # configure Træfik dashboard to be the exposed service
- traefik.http.routers.https-${TRAEFIK_ROUTER_NAME}.rule=Host(`${TRAEFIK_MATCHRULE}`) - traefik.http.routers.https-${TRAEFIK_ROUTER}.rule=Host(`${TRAEFIK_MATCHRULE}`)
- traefik.http.routers.https-${TRAEFIK_ROUTER_NAME}.service=api@internal - traefik.http.routers.https-${TRAEFIK_ROUTER}.service=api@internal
# of course, enable TLS and it's certificate provider # of course, enable TLS and it's certificate provider
- traefik.http.routers.https-${TRAEFIK_ROUTER_NAME}.tls=true - traefik.http.routers.https-${TRAEFIK_ROUTER}.tls=true
- traefik.http.routers.https-${TRAEFIK_ROUTER_NAME}.tls.certresolver=letsencrypt - traefik.http.routers.https-${TRAEFIK_ROUTER}.tls.certresolver=letsencrypt
networks: networks:
- traefik-proxy - traefik-proxy
ports: ports:
@ -66,7 +66,7 @@ services:
- 443:443 - 443:443
volumes: volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro - /var/run/docker.sock:/var/run/docker.sock:ro
- ./config:/dynamic-config:ro - ./config:/config:ro
- ./le-certs.json:/le-certs.json - ./le-certs.json:/le-certs.json
networks: networks:

View File

@ -1,7 +1,7 @@
TRAEFIK_VERSION=2.4 TRAEFIK_VERSION=2.4
TRAEFIK_CONTAINER_NAME=traefik.mydomain.com TRAEFIK_CONTAINER_NAME=traefik.mydomain.com
TRAEFIK_MATCHRULE=traefik.mydomain.com TRAEFIK_MATCHRULE=traefik.mydomain.com
TRAEFIK_ROUTER_NAME=traefik_mydomain_com TRAEFIK_ROUTER=traefik_mydomain_com
TRAEFIK_LOGLEVEL=INFO TRAEFIK_LOGLEVEL=INFO
TRAEFIK_PILOT_TOKEN= TRAEFIK_PILOT_TOKEN=
TRAEFIK_DASHBOARD_WHITELIST=1.2.3.4/24 TRAEFIK_DASHBOARD_WHITELIST=1.2.3.4/24