Hey community!
I'm using docker as a provider and at the moment trying to configure self signed certificates for Treafik. I'm following step by step all the settings but it seems I'm missing something as Traefik keeps serving its own certs.
This is my docker-compose.yml:
version: '3.7'
services:
# traefik service
traefik:
image: "traefik:v2.2"
command:
- --providers.file.filename=/dynconf/dyn.toml
- --providers.file.watch=true
labels:
- "traefik.enable=true"
- "traefik.http.routers.to-dashboard.rule=Host(`dashboard.local`)"
- "traefik.http.routers.to-dashboard.entrypoints=dashboard"
- "traefik.http.routers.to-dashboard.middlewares=auth"
- "traefik.http.routers.to-dashboard.service=api@internal"
- "traefik.http.middlewares.auth.basicauth.users=test:<redacted>"
container_name: "traefik"
ports:
- "11000:80"
- "11001:443"
- "127.0.0.1:11002:8181"
volumes:
- "/var/run/docker.sock:/var/run/docker.sock:ro"
- "/home/traefik/traefik.toml:/traefik.toml:ro"
- "/home/traefik/dynconf/dyn.toml:/dynconf/dyn.toml"
- "/home/traefik/certs/:/certs/"
whoami:
image: "traefik/whoami"
container_name: "whoami"
labels:
- "traefik.enable=true"
- "traefik.http.routers.to-whoami.rule=Host(`container.internal`)"
- "traefik.http.routers.to-whoami.entrypoints=web"
- "traefik.http.routers.to-whoami.middlewares=https_redirect"
- "traefik.http.routers.to-whoami-secure.rule=Host(`container.internal`)"
- "traefik.http.routers.to-whoami-secure.entrypoints=websecure"
- "traefik.http.routers.to-whoami-secure.tls=true"
- "traefik.http.middlewares.https_redirect.redirectscheme.scheme=https"
- "traefik.http.middlewares.https_redirect.redirectscheme.permanent=true"
httpecho2:
image: "hashicorp/http-echo"
container_name: "httpecho1"
command: "-text='whoami hello world'"
labels:
- "traefik.enable=true"
- "traefik.http.routers.to-httpecho2.rule=Host(`container.internal`) && Path(`/httpecho`)"
- "traefik.http.routers.to-httpecho2.entrypoints=web"
- "traefik.http.routers.to-httpecho2.middlewares=https_redirect"
- "traefik.http.routers.to-httpecho2-secure.rule=Host(`container.internal`) && Path(`/httpecho`)"
- "traefik.http.routers.to-httpecho2-secure.entrypoints=websecure"
- "traefik.http.routers.to-httpecho2-secure.entrypoints=websecure"
- "traefik.http.routers.to-httpecho2-secure.tls=true"
- "traefik.http.middlewares.https_redirect.redirectscheme.scheme=https"
- "traefik.http.middlewares.https_redirect.redirectscheme.permanent=true"
networks:
default:
external:
name: "traefik_network"
And this is my dynamic configuration:
[[tls.certificates]]
certFile = "/certs/container.crt"
keyFile = "/certs/container.key"
Would appreciate any recommendations.
Thanks