# Issues with the Docker Provider

**URL:** <https://community.traefik.io/t/issues-with-the-docker-provider/22801>\
**Category:** Traefik v2\
**Tags:** file, docker, docker-swarm\
**Created:** [May 19, 2024, 8:59pm UTC](https://community.traefik.io/t/issues-with-the-docker-provider/22801 "2024-05-19T20:59:27Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![jrCleber](https://sea2.discourse-cdn.com/flex020/user_avatar/community.traefik.io/jrcleber/32/7583_2.png) [@jrCleber](https://community.traefik.io/u/jrCleber)\
**Post date:** [May 19, 2024, 8:59pm UTC](https://community.traefik.io/t/issues-with-the-docker-provider/22801/1 "2024-05-19T20:59:27Z")

</div>

```toml
[global]
  checkNewVersion = false
  sendAnonymousUsage = false

[entryPoints]
  [entryPoints.websecure]
    address = ":443"
    [entryPoints.websecure.http]
      tls = { }

  [entryPoints.web]
    address = ":80"
    [entryPoints.web.http]
      [entryPoints.web.http.redirections]
        [entryPoints.web.http.redirections.entryPoint]
          to = "websecure"
          scheme = "https"
          permanent = true
          priority = 1

[log]
  level = "DEBUG"
  filePath = "./log/traefik.json"
  format = "json"
  maxSize = 100
  maxAge = 30

[accessLog]
  filePath = "./log/access.log"
  format = "json"
  bufferingSize = 100

[api]
  dashboard = true

[providers]
  [providers.file]
  filename = "./dynamic/conf.toml"
  watch = true

  [providers.docker]
    swarmMode = true
    endpoint = "unix:///var/run/docker.sock"
    exposedByDefault = false
    network = "public_network"
    watch = true

[certificatesResolvers.letsencryptresolver.acme]
  email = "admin@test.com"
  storage = "./letsencrypt/acme.json"
  [certificatesResolvers.letsencryptresolver.acme.httpChallenge]
    entryPoint = "web"

```

This is my Traefik configuration in version **2.11.2**.

In my portainer stack I configured the following tags:

```yaml
        labels:
          - 'traefik.enable=true'
          - 'traefik.docker.network=public_network'
          - 'traefik.http.routers.portainer.rule=Host(`portainer.domain.com`)'
          - 'traefik.http.routers.portainer.entrypoints=websecure'
          - 'traefik.http.routers.portainer.priority=1'
          - 'traefik.http.routers.portainer.tls.certresolver=letsencryptresolver'
          - 'traefik.http.routers.portainer.service=portainer'
          - 'traefik.http.services.portainer.loadbalancer.server.port=9000'

```

* * *

By running traffic inside a container with the aforementioned settings, you can access the perfect domain. But when I run the [traefik binary](https://github.com/traefik/traefik/releases/tag/v2.11.2), outside the container, with the same settings, I get **Gateway time-out Error code 504** on the page.

But, I also enabled the file provider and the routers and services I configured in the file work perfectly, but the docker swarm one doesn't.

I imagine it's a network problem. I searched the logs but didn't find any errors.

Has anyone experienced this and have any ideas on how to resolve it?

---

<div class="post-metadata">

**Author:** ![bluepuma77](https://avatars.discourse-cdn.com/v4/letter/b/a9adbd/32.png) [@bluepuma77](https://community.traefik.io/u/bluepuma77)\
**Post date:** [May 20, 2024, 7:09am UTC](https://community.traefik.io/t/issues-with-the-docker-provider/22801/2 "2024-05-20T07:09:05Z")

</div>

Isn’t `providers.swarm` new in Traefik v3?

You can’t use Traefik outside Docker with Docker (Swarm) Configuration Discovery, as Traefik will try to connect via IPs inside an implicit or explicit Docker Network, to which non Docker apps have no access.

---

<div class="post-metadata">

**Author:** ![jrCleber](https://sea2.discourse-cdn.com/flex020/user_avatar/community.traefik.io/jrcleber/32/7583_2.png) [@jrCleber](https://community.traefik.io/u/jrCleber)\
**Post date:** [May 20, 2024, 10:30am UTC](https://community.traefik.io/t/issues-with-the-docker-provider/22801/3 "2024-05-20T10:30:20Z")

</div>

Thanks for your response.

Traefik was designed to be used outside of Docker. I've been using it for a while with Docker. But when I enabled swarm mode I had this problem.

---

<div class="post-metadata">

**Author:** ![bluepuma77](https://avatars.discourse-cdn.com/v4/letter/b/a9adbd/32.png) [@bluepuma77](https://community.traefik.io/u/bluepuma77)\
**Post date:** [May 20, 2024, 11:44am UTC](https://community.traefik.io/t/issues-with-the-docker-provider/22801/4 "2024-05-20T11:44:22Z")

</div>

With Docker Swarm, we use a Docker Overlay Network and Traefik within container.

Check [simple Traefik Swarm example](https://github.com/bluepuma77/traefik-best-practice/tree/main/docker-swarm-traefik).
