in service_name@docker and service_name@file what you have on the right side of @ is not a service but configuration provider. If you provide configuration via docker labels then it's @docker if you provide it via dynamic_conf.yml (or TOML) file, then it's @file
Sorry, I was wrong to write, the concept of provider is clear to me, my question is then this: it is possible to expose a Docker container through the dynamic_conf.yml file or the only way to do it is to insert the labels directly in the docker-compose .yml file?
But you can. What I asked you above is what seems to be the problem with that?
My guess is that you tried, saw some error or unexpeted behaviour and mis-interpreted it. But unless you say what it is, it's very difficult to help.
Caveat: you can centralize dymaic configuration there which is not to be mixed with static configuration But in practical sense that should be what you are after anyway. You do not have to use docker-compose and you do not have to use labels.
In your example you will need instead of specifying service port specify service url.
The disadvantage is of course since you are not using docker provider (which is label based) you will not have the automatic discovery.
What problem are you trying to solve? Everything fits to respective purpose. Docker labels with docker is probably the most convenient way working with docker, because of the discovery. However sometimes it's convenient to control traefik externally. While API achieves that, it is not persisted, so the File Provider is the best bet then. Obviously, it's most useful when your services/backends are outside of the docker instance that hosts traefik.
@ldez I don't have any reference to documentation hand to back this up, but if memory serves me well it does not have to be ip address. If you are on the same docker network (as traefik) you can address your container by name (and port). Also in this case you do not have to expose the port on the non-traefik container.
This largely mitigates poits 1 and 2 at the bottom of your post. 3 though still stands and is a very strong reason to prefer labels.