# .toml file versus docker labels

**URL:** <https://community.traefik.io/t/toml-file-versus-docker-labels/7823>\
**Category:** Traefik v2\
**Tags:** middleware, docker\
**Created:** [September 23, 2020, 2:51pm UTC](https://community.traefik.io/t/toml-file-versus-docker-labels/7823 "2020-09-23T14:51:49Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![cipherkit](https://sea2.discourse-cdn.com/flex020/user_avatar/community.traefik.io/cipherkit/32/2609_2.png) [@cipherkit](https://community.traefik.io/u/cipherkit)\
**Post date:** [September 23, 2020, 2:51pm UTC](https://community.traefik.io/t/toml-file-versus-docker-labels/7823/1 "2020-09-23T14:51:49Z")

</div>

Specifically for middleware and such. Can I specify a middleware in the relatively easy to use .toml file and then have traefik find the docker port by label and complete the process?

---

<div class="post-metadata">

**Author:** ![cakiwi](https://sea2.discourse-cdn.com/flex020/user_avatar/community.traefik.io/cakiwi/32/3205_2.png) [@cakiwi](https://community.traefik.io/u/cakiwi)\
**Post date:** [September 23, 2020, 3:07pm UTC](https://community.traefik.io/t/toml-file-versus-docker-labels/7823/2 "2020-09-23T15:07:56Z")

</div>

As per a post yesterday. If you define the middleware in one provider and want to utilise it in another suffix the middleware with `@provider` i.e.

```yaml
...
services:
  foo:
  ...
  labels:
    traefik.http.routers.foo.middlewares: mymiddleware@file

```
