Cannot get access to traefik WebUI

Hello everyone,

I am trying to install traefik alongside with portainer. I suceeded but only partially because i cannot get access to the traefik webui dashboard.
i am using docker compose to deploy this stack. i don't use a .toml for traefik configuration, only labels.
Any idea what i am doing wrong ?

Here is my docker-compose file:

version: "3.3"

services:
  traefik:
    container_name: traefik
    image: "traefik:latest"
    command:
      - --entrypoints.web.address=:80
      - --entrypoints.websecure.address=:443
      - --providers.docker
      - --api
      - --api.dashboard=true
      - --log.level=ERROR
      - --certificatesresolvers.leresolver.acme.httpchallenge=true
      - --certificatesresolvers.leresolver.acme.email=myemail@mail.com #Set your email address here, is for the generation of SSL certificates with Let's Encrypt.
      - --certificatesresolvers.leresolver.acme.storage=./path/to/traefik/acme.json
      - --certificatesresolvers.leresolver.acme.httpchallenge.entrypoint=web
    ports:
      - "80:80"
      - "443:443"
      - "8081:8080" #port 8080 already used by another service on server
    volumes:
      - "/var/run/docker.sock:/var/run/docker.sock:ro"
      - "./path/to/traefik/acme.json:/acme.json"
    labels:
      - "traefik.http.routers.http-catchall.rule=hostregexp(`{host:.+}`)"
      - "traefik.http.routers.http-catchall.entrypoints=web"
      - "traefik.http.routers.http-catchall.middlewares=redirect-to-https"
      - "traefik.enable=true"
      - "traefik.http.routers.traefik.rule=Host(`traefik.mydomain.com`)"
      - "traefik.http.routers.traefik.service=api@internal"
      - "traefik.http.routers.traefik.tls.certresolver=leresolver"
      - "traefik.http.routers.traefik.entrypoints=websecure"
      - "traefik.http.routers.traefik.middlewares=authtraefik"
      - "traefik.http.middlewares.authtraefik.basicauth.users=admin:ASuperPassword"
      - "traefik.http.middlewares.redirect-to-https.redirectscheme.scheme=https"

  portainer:
    image: portainer/portainer-ce
    command: -H unix:///var/run/docker.sock
    restart: always
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock
      - portainer_data:/data
    labels:
      # Frontend
      - "traefik.enable=true"
      - "traefik.http.routers.frontend.rule=Host(`portainer.mydomain.com`)"
      - "traefik.http.routers.frontend.entrypoints=websecure"
      - "traefik.http.services.frontend.loadbalancer.server.port=9000"
      - "traefik.http.routers.frontend.service=frontend"
      - "traefik.http.routers.frontend.tls.certresolver=leresolver"

      # Edge
      - "traefik.http.routers.edge.rule=Host(`edge.mydomain.com`)"
      - "traefik.http.routers.edge.entrypoints=websecure"
      - "traefik.http.services.edge.loadbalancer.server.port=8000"
      - "traefik.http.routers.edge.service=edge"
      - "traefik.http.routers.edge.tls.certresolver=leresolver"


volumes:
  portainer_data:

When you say "stack" do you refer to docker swarm? Also can you describe "cannot get access to the traefik webui dashboard"? What are you doing and what are you observing?

Hello Zespri,

Thank you for your answer. When i say stack i refer to th group of docker containers being deployed from this docker-compose file. I use "stack" word because this is how it's named in the portainer UI.
When i try to get access to the traefik UI, i either try to reach traefik.mydomain.com or mydomain.com:8081.
for traefik.mydomain.com i get a very fast answer stating that this website cannot be found ( i declared the A record on my domain name targeting my server IP address).
For mydomain.com:8081 it takes a bit more time to get this same error.

Thank you for your help.

Simon