Experimental: Update traefik Host() rules for v3

This commit is contained in:
Tom Wiesing 2023-04-12 19:21:11 +02:00
parent 34db2e1923
commit 285aaff77d
No known key found for this signature in database
10 changed files with 60 additions and 13 deletions

View file

@ -2,7 +2,8 @@ DATA_PATH=${DATA_PATH}
RUNTIME_DIR=${RUNTIME_DIR}
SLUG=${SLUG}
VIRTUAL_HOST=${VIRTUAL_HOST}
HOSTNAME=${HOSTNAME}
HOST_RULE=${HOST_RULE}
DOCKER_NETWORK_NAME=${DOCKER_NETWORK_NAME}
HTTPS_ENABLED=${HTTPS_ENABLED}

View file

@ -4,14 +4,14 @@ services:
barrel:
build: .
restart: always
hostname: ${VIRTUAL_HOST}.wisski
hostname: ${HOSTNAME}
# label it with the current slug
labels:
- "traefik.enable=True"
- "eu.wiss-ki.barrel.distillery=${DOCKER_NETWORK_NAME}"
- "traefik.http.routers.wisski_${SLUG}.rule=Host(`${VIRTUAL_HOST}`)"
- "traefik.http.routers.wisski_${SLUG}.rule=${HOST_RULE}"
- "traefik.http.routers.wisski_${SLUG}.tls=${HTTPS_ENABLED}"
- "traefik.http.routers.wisski_${SLUG}.tls.certresolver=distillery"
- "traefik.http.services.wisski_${SLUG}.loadbalancer.server.port=8080"

View file

@ -25,7 +25,8 @@ func (barrel *Barrel) Stack() component.StackWithResources {
"DOCKER_NETWORK_NAME": barrel.Malt.Config.Docker.Network(),
"SLUG": barrel.Slug,
"VIRTUAL_HOST": barrel.Domain(),
"HOST_RULE": barrel.HostRule(),
"HOSTNAME": barrel.Hostname(),
"HTTPS_ENABLED": barrel.Malt.Config.HTTP.HTTPSEnabledEnv(),
"DATA_PATH": filepath.Join(barrel.FilesystemBase, "data"),