Make Keycloak optional
continuous-integration/drone/push Build is failing Details

This commit is contained in:
3wc 2020-09-30 01:40:35 +02:00
parent fe460f3d9f
commit e78227a29f
4 changed files with 35 additions and 9 deletions

View File

@ -1,5 +1,17 @@
export DOMAIN=traefik.swarm.autonomic.zone
export FILE_PROVIDER_YML_VERSION=v1
export LETS_ENCRYPT_ENV=staging
export SERVICE=traefik
export STACK_NAME=traefik
export DOMAIN=traefik.example.com
export LETS_ENCRYPT_ENV=production
# export DASHBOARD_ENABLED=true
# WARN, INFO etc.
export LOG_LEVEL=WARN
export TRAEFIK_YML_VERSION=v1
## Enable Keycloak
#export COMPOSE_FILE="compose.yml:compose.keycloak.yml"
#export FILE_PROVIDER_ENABLED=1
## Options for file-provider / Keycloak SSO
#export FILE_PROVIDER_YML_VERSION=v1

18
compose.keycloak.yml Normal file
View File

@ -0,0 +1,18 @@
---
version: "3.8"
services:
traefik:
configs:
- source: file_provider_yml
target: /etc/traefik/file-provider.yml
deploy:
labels:
- "traefik.http.routers.traefik.middlewares=keycloak@file"
environment:
- FILE_PROVIDER_ENABLED
configs:
file_provider_yml:
name: ${STACK_NAME}_file_provider_yml_${FILE_PROVIDER_YML_VERSION}
file: file-provider.yml

View File

@ -15,8 +15,6 @@ services:
configs:
- source: traefik_yml
target: /etc/traefik/traefik.yml
- source: file_provider_yml
target: /etc/traefik/file-provider.yml
networks:
- proxy
environment:
@ -39,7 +37,6 @@ services:
- "traefik.http.routers.traefik.entrypoints=web-secure"
- "traefik.http.routers.traefik.tls.certresolver=${LETS_ENCRYPT_ENV}"
- "traefik.http.routers.traefik.service=api@internal"
- "traefik.http.routers.traefik.middlewares=keycloak@file"
networks:
proxy:
@ -50,9 +47,6 @@ configs:
name: ${STACK_NAME}_traefik_yml_${TRAEFIK_YML_VERSION}
file: traefik.yml
template_driver: golang
file_provider_yml:
name: ${STACK_NAME}_file_provider_yml_${FILE_PROVIDER_YML_VERSION}
file: file-provider.yml
volumes:
letsencrypt:

View File

@ -8,8 +8,10 @@ providers:
exposedByDefault: false
network: proxy
swarmMode: true
{{ if eq (env "FILE_PROVIDER_ENABLED") "1" }}
file:
filename: /etc/traefik/file-provider.yml
{{ end }}
api:
dashboard: {{ env "DASHBOARD_ENABLED" }}