dockerdocker-composetraefik

Configuring Traefik to use a different SSL port using just commands and just valid SSL certificates


At the Traefik example posted at:

https://github.com/bluepuma77/traefik-best-practice/blob/main/docker-traefik-dashboard-letsencrypt/docker-compose.yml

a) How this code can be modified to NoT use Letsecnrypt and just use some valid ssl certificates while using just commands i.e. under the command: section?

b) How can Traefik be forced to listen at "secured" host port 8443 and forward to its secured port 443?

Thanks in advance


Solution

  • For existing TLS certs, you need to load them in a dynamic config file (doc), which is loaded via providers.file in Traefik static config.

    Then you simply need to enable TLS on entrypoint or router with .tls=true (labels) or tls: {} (yaml).

    For using a different port externally, you can set that up with ports: in Docker compose.yml.