Traefik
From Leo's Notes
This page was last edited on 26 January 2021, at 18:15.
Docker
The traefik docker backend is configured by labeling your docker containers.
Traefik v2
You must have separate routers for each entrypoint. Listing them as entrypoints=http,https doesn't work.
labels:
- traefik.enable=true
- traefik.docker.network=traefik
# service
- traefik.http.services.gitlab-service.loadbalancer.server.port=8888
# https
- traefik.http.routers.gitlab-https.entrypoints=https
- traefik.http.routers.gitlab-https.rule=Host(`gitlab.example.com`)
- traefik.http.routers.gitlab-https.tls=true
- traefik.http.routers.gitlab-https.tls.certresolver=letsencrypt
- traefik.http.routers.gitlab-https.service=gitlab-service
# http
- traefik.http.routers.gitlab.entrypoints=http
- traefik.http.routers.gitlab.rule=Host(`gitlab.example.com`)
- traefik.http.routers.gitlab.service=gitlab-service