From 7c2c2276d9ef9e634cd26b3ba3907d147f32dab0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebasti=C3=A1n=20Ram=C3=ADrez?= Date: Mon, 6 Apr 2020 12:38:28 +0200 Subject: [PATCH] :recycle: Simplify Traefik labels in services (#139) --- .../docker-compose.deploy.labels.yml | 27 +++++++------------ 1 file changed, 9 insertions(+), 18 deletions(-) diff --git a/{{cookiecutter.project_slug}}/docker-compose.deploy.labels.yml b/{{cookiecutter.project_slug}}/docker-compose.deploy.labels.yml index 8f3c675..0fa9b91 100644 --- a/{{cookiecutter.project_slug}}/docker-compose.deploy.labels.yml +++ b/{{cookiecutter.project_slug}}/docker-compose.deploy.labels.yml @@ -8,11 +8,8 @@ services: - traefik.port=5050 - traefik.tags=${TRAEFIK_PUBLIC_TAG} - traefik.docker.network=${TRAEFIK_PUBLIC_NETWORK} - # Traefik service that listens to HTTP - - traefik.redirectorservice.frontend.entryPoints=http - - traefik.redirectorservice.frontend.redirect.entryPoint=https - # Traefik service that listens to HTTPS - - traefik.webservice.frontend.entryPoints=https + - traefik.frontend.entryPoints=http,https + - traefik.frontend.redirect.entryPoint=https proxy: deploy: labels: @@ -25,18 +22,15 @@ services: - traefik.port=80 - traefik.tags=${TRAEFIK_PUBLIC_TAG} - traefik.docker.network=${TRAEFIK_PUBLIC_NETWORK} - # Traefik service that listens to HTTP - - traefik.servicehttp.frontend.entryPoints=http - - traefik.servicehttp.frontend.redirect.entryPoint=https - # Traefik service that listens to HTTPS - - traefik.servicehttps.frontend.entryPoints=https + - traefik.frontend.entryPoints=http,https + - traefik.frontend.redirect.entryPoint=https # Uncomment the config line below to detect and redirect www to non-www (or the contrary) # The lines above for traefik.frontend.rule are needed too - # - "traefik.servicehttps.frontend.redirect.regex=^https?://(www.)?(${DOMAIN})/(.*)" + # - "traefik.frontend.redirect.regex=^https?://(www.)?(${DOMAIN})/(.*)" # To redirect from non-www to www un-comment the line below - # - "traefik.servicehttps.frontend.redirect.replacement=https://www.${DOMAIN}/$$3" + # - "traefik.frontend.redirect.replacement=https://www.${DOMAIN}/$$3" # To redirect from www to non-www un-comment the line below - # - "traefik.servicehttps.frontend.redirect.replacement=https://${DOMAIN}/$$3" + # - "traefik.frontend.redirect.replacement=https://${DOMAIN}/$$3" flower: deploy: labels: @@ -45,11 +39,8 @@ services: - traefik.port=5555 - traefik.tags=${TRAEFIK_PUBLIC_TAG} - traefik.docker.network=${TRAEFIK_PUBLIC_NETWORK} - # Traefik service that listens to HTTP - - traefik.redirectorservice.frontend.entryPoints=http - - traefik.redirectorservice.frontend.redirect.entryPoint=https - # Traefik service that listens to HTTPS - - traefik.webservice.frontend.entryPoints=https + - traefik.frontend.entryPoints=http,https + - traefik.frontend.redirect.entryPoint=https backend: deploy: labels: