feat(Traefik): Add default value in yml

This commit is contained in:
Simon 2021-03-09 09:30:20 +01:00
parent 47d0224163
commit 48b1cdf519
3 changed files with 8 additions and 13 deletions

View File

@ -6,5 +6,4 @@ COMPOSE_FILE=../../traefik/docker-compose.yml
TRAEFIK_VOLUME_NAME=kifeart
TRAEFIK_NETWORK_NAME=kifeart
TRAEFIK_CONTAINER_NAME=kifeart
TRAEFIK_IMAGE=traefik:v2.4.5
TRAEFIK_DOMAIN=traefik.cool.life

View File

@ -1,5 +1 @@
TRAEFIK_VOLUME_NAME=traefik
TRAEFIK_NETWORK_NAME=traefik
TRAEFIK_CONTAINER_NAME=traefik
TRAEFIK_IMAGE=traefik:v2.4.5
TRAEFIK_DOMAIN=localhost

View File

@ -2,20 +2,20 @@ version: "3.8"
volumes:
traefik:
name: ${TRAEFIK_VOLUME_NAME}
name: ${TRAEFIK_VOLUME_NAME:-traefik}
networks:
traefik:
name: ${TRAEFIK_NETWORK_NAME}
name: ${TRAEFIK_NETWORK_NAME:-traefik}
services:
traefik:
container_name: ${TRAEFIK_CONTAINER_NAME}
image: ${TRAEFIK_IMAGE}
container_name: ${TRAEFIK_CONTAINER_NAME:-traefik}
image: ${TRAEFIK_IMAGE:-traefik:v2.4.5}
restart: always
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- ${TRAEFIK_VOLUME_NAME}:/traefik
- ${TRAEFIK_VOLUME_NAME:-traefik}:/traefik
- /etc/timezone:/etc/timezone:ro
- /etc/localtime:/etc/localtime:ro
ports:
@ -24,7 +24,7 @@ services:
protocol: tcp
mode: host
networks:
- ${TRAEFIK_NETWORK_NAME}
- ${TRAEFIK_NETWORK_NAME:-traefik}
command:
- --api.insecure=true
- --log.level=INFO
@ -34,14 +34,14 @@ services:
- --providers.docker
- --providers.docker.exposedbydefault=false
- --providers.docker.network=${TRAEFIK_NETWORK_NAME}
- --providers.docker.network=${TRAEFIK_NETWORK_NAME:-traefik}
- --entrypoints.web.address=:80
- --entryPoints.web.forwardedHeaders.insecure
labels:
traefik.enable: 'true'
traefik.http.routers.traefik.rule: 'Host(`${TRAEFIK_DOMAIN}`)'
traefik.http.routers.traefik.rule: 'Host(`${TRAEFIK_DOMAIN:?err}`)'
traefik.http.routers.traefik.entrypoints: 'web'
traefik.http.services.traefik.loadbalancer.server.port: '8080'