Enable EXTRA_DOMAINS redirects

See compose-stacks/organising#15
This commit is contained in:
3wc 2020-10-01 20:33:37 +02:00
parent 1572a1fdde
commit 096d83445a

View File

@ -32,18 +32,16 @@ services:
constraints: constraints:
- node.role == manager - node.role == manager
labels: labels:
- traefik.enable=true - "traefik.enable=true"
- traefik.docker.network=proxy - "traefik.docker.network=proxy"
#- traefik.constraint-label=proxy - "traefik.http.routers.${STACK_NAME}.rule=Host(`${DOMAIN}`${EXTRA_DOMAINS})"
- traefik.http.routers.${STACK_NAME}-http.rule=Host(`${DOMAIN?Variable not set}`) - "traefik.http.routers.${STACK_NAME}.entrypoints=web-secure"
- traefik.http.routers.${STACK_NAME}-http.entrypoints=web - "traefik.http.routers.${STACK_NAME}.tls=true"
# Add https-redirect middleware from https://dockerswarm.rocks/traefik/ - "traefik.http.routers.${STACK_NAME}.tls.certresolver=${LETS_ENCRYPT_ENV}"
#- traefik.http.routers.${STACK_NAME}-http.middlewares=https-redirect - "traefik.http.services.${STACK_NAME}.loadbalancer.server.port=8080"
- traefik.http.routers.${STACK_NAME}-https.rule=Host(`${DOMAIN?Variable not set}`) - "traefik.http.routers.${STACK_NAME}.middlewares=${STACK_NAME}-redirect"
- traefik.http.routers.${STACK_NAME}-https.entrypoints=web-secure - "traefik.http.middlewares.${STACK_NAME}-redirect.headers.SSLForceHost=true"
- traefik.http.routers.${STACK_NAME}-https.tls=true - "traefik.http.middlewares.${STACK_NAME}-redirect.headers.SSLHost=${DOMAIN}"
- traefik.http.routers.${STACK_NAME}-https.tls.certresolver=${LETS_ENCRYPT_ENV}
- traefik.http.services.${STACK_NAME}.loadbalancer.server.port=8080
db: db:
image: couchdb:2.3.1 image: couchdb:2.3.1
@ -62,6 +60,7 @@ services:
#placement: #placement:
# constraints: # constraints:
# - node.labels.swarmpit.db-data == true # - node.labels.swarmpit.db-data == true
influxdb: influxdb:
image: influxdb:1.8 image: influxdb:1.8
volumes: volumes: