Skip to content

Commit

Permalink
♻️ Simplify Traefik labels in services (fastapi#139)
Browse files Browse the repository at this point in the history
  • Loading branch information
tiangolo authored Apr 6, 2020
1 parent cf512a1 commit d40491d
Showing 1 changed file with 9 additions and 18 deletions.
27 changes: 9 additions & 18 deletions {{cookiecutter.project_slug}}/docker-compose.deploy.labels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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:
Expand All @@ -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:
Expand Down

0 comments on commit d40491d

Please sign in to comment.