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_VOLUME_NAME=kifeart
TRAEFIK_NETWORK_NAME=kifeart TRAEFIK_NETWORK_NAME=kifeart
TRAEFIK_CONTAINER_NAME=kifeart TRAEFIK_CONTAINER_NAME=kifeart
TRAEFIK_IMAGE=traefik:v2.4.5
TRAEFIK_DOMAIN=traefik.cool.life 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 TRAEFIK_DOMAIN=localhost

View File

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