diff --git a/docker-compose.yaml b/docker-compose.yaml index 0c5b1b0..3a30c64 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -8,22 +8,22 @@ services: - ${ENV_FILE:-.env} labels: - "traefik.enable=true" - - "traefik.http.routers.${PROJECT_NAME:-mb-grid-solutions}.rule=Host(${TRAEFIK_HOST:-mb-grid-solutions.localhost})" + - "traefik.http.routers.${PROJECT_NAME:-mb-grid-solutions}.rule=Host(`${TRAEFIK_HOST:-mb-grid-solutions.localhost}`)" - "traefik.http.routers.${PROJECT_NAME:-mb-grid-solutions}.entrypoints=websecure" - "traefik.http.routers.${PROJECT_NAME:-mb-grid-solutions}.tls.certresolver=le" - "traefik.http.routers.${PROJECT_NAME:-mb-grid-solutions}.tls=true" - "traefik.http.services.${PROJECT_NAME:-mb-grid-solutions}.loadbalancer.server.port=3000" - "traefik.http.routers.${PROJECT_NAME:-mb-grid-solutions}.middlewares=${PROJECT_NAME:-mb-grid-solutions}-auth" - # Gatekeeper Router - - "traefik.http.routers.${PROJECT_NAME:-mb-grid-solutions}-gatekeeper.rule=Host(${TRAEFIK_HOST:-mb-grid-solutions.localhost}) && PathPrefix(`/gatekeeper`)" + # Gatekeeper Router (Shared Host + dedicated Subdomain) + - "traefik.http.routers.${PROJECT_NAME:-mb-grid-solutions}-gatekeeper.rule=(Host(`${TRAEFIK_HOST:-mb-grid-solutions.localhost}`) && PathPrefix(`/gatekeeper`)) || Host(`gatekeeper.${TRAEFIK_HOST:-mb-grid-solutions.localhost}`)" - "traefik.http.routers.${PROJECT_NAME:-mb-grid-solutions}-gatekeeper.entrypoints=websecure" - "traefik.http.routers.${PROJECT_NAME:-mb-grid-solutions}-gatekeeper.tls.certresolver=le" - "traefik.http.routers.${PROJECT_NAME:-mb-grid-solutions}-gatekeeper.tls=true" - "traefik.http.routers.${PROJECT_NAME:-mb-grid-solutions}-gatekeeper.service=${PROJECT_NAME:-mb-grid-solutions}-gatekeeper" # Auth Middleware Definition - - "traefik.http.middlewares.${PROJECT_NAME:-mb-grid-solutions}-auth.forwardauth.address=http://gatekeeper:3000/api/verify" + - "traefik.http.middlewares.${PROJECT_NAME:-mb-grid-solutions}-auth.forwardauth.address=http://${PROJECT_NAME:-mb-grid-solutions}-gatekeeper:3000/api/verify" - "traefik.http.middlewares.${PROJECT_NAME:-mb-grid-solutions}-auth.forwardauth.trustForwardHeader=true" - "traefik.http.middlewares.${PROJECT_NAME:-mb-grid-solutions}-auth.forwardauth.authResponseHeaders=X-Auth-User" @@ -31,7 +31,9 @@ services: image: registry.infra.mintel.me/mintel/gatekeeper:latest restart: always networks: - - infra + infra: + aliases: + - ${PROJECT_NAME:-mb-grid-solutions}-gatekeeper env_file: - ${ENV_FILE:-.env} environment: @@ -68,7 +70,7 @@ services: - ./directus/extensions:/directus/extensions labels: - "traefik.enable=true" - - "traefik.http.routers.${PROJECT_NAME:-mb-grid-solutions}-directus.rule=Host(${DIRECTUS_HOST:-cms.mb-grid-solutions.localhost})" + - "traefik.http.routers.${PROJECT_NAME:-mb-grid-solutions}-directus.rule=Host(`${DIRECTUS_HOST:-cms.mb-grid-solutions.localhost}`)" - "traefik.http.routers.${PROJECT_NAME:-mb-grid-solutions}-directus.entrypoints=websecure" - "traefik.http.routers.${PROJECT_NAME:-mb-grid-solutions}-directus.tls.certresolver=le" - "traefik.http.routers.${PROJECT_NAME:-mb-grid-solutions}-directus.tls=true"