Traefik uses static (entrypoints, providers, certresolver, etc.) and dynamic (routers, middlewares, services, tls, etc.) configuration (doc). The dynamic configuration needs to be loaded by a provider in static config, like providers.docker or providers.file.
Check simple Traefik example (and the other folders) for best practice.