Can't get dashboard to work in docker swarm docker compose

I can get traefik 2.2 to work just fine in NON swarm mode. Once I turn that on it all goes to crap. I have made so many changes that I have to start over. So the first step is to get traefik 2.2 to run in a swarm stack and access the dashboard via monitor.fe.net not the port of 8080. That works just fine specifying the port. I think this is all related to docker swarm and labels etc. So any help would be appreciated.

 version: "3.0"

services:
  traefik:
    image: traefik:v2.2
    ports:
      - "80:80"
    #  - "8081:8080" # traefik dashboard
      - "443:443"
    command:
      - --api.insecure=true 
      - --api.dashboard=true 
      - --api.debug=true 
      - --log.level=DEBUG 
      - --providers.docker=true
      - --providers.docker.endpoint=unix:///var/run/docker.sock
      - --providers.docker.swarmMode=true
      - --providers.docker.exposedbydefault=false
      - --providers.docker.network=traefik-public
      - --entrypoints.web.address=:80
      - --entrypoints.web-secured.address=:443
    #  - --entrypoints.traefik.address=:8081
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock:ro
    networks:
      - traefik-public
    deploy:
      placement:
        constraints:
          - node.role == manager
      labels:
        - "traefik.enable=true" 
        - "traefik.http.routers.api.entrypoints=web"
        - "traefik.http.routers.api.rule=Host(`monitor.fe.net`)" 
        - "traefik.http.routers.api.service=api@internal" 
        - "traefik.http.routers.api.middlewares=auth"
        - "traefik.http.middlewares.auth.basicauth.users=secretstuff" 
networks:
  traefik-public:
    external: true
      

i missed the port...

    - "traefik.http.services.api.loadbalancer.server.port=8080"

it all works now.

For anyone who come across this post, the service port for the dashboard api is any dummy port for swarm.

From Dashboard Secure Example

# Dynamic Configuration
deploy:
  labels:
    - "traefik.http.routers.api.rule=Host(`traefik.example.com`)"
    - "traefik.http.routers.api.service=api@internal"
    - "traefik.http.routers.api.middlewares=auth"
    - "traefik.http.middlewares.auth.basicauth.users=test:$apr1$H6uskkkW$IgXLP6ewTrSuBkTrqE8wj/,test2:$apr1$d9hr9HBB$4HxwgUir3HP4EsggP/QNo0"
    # Dummy service for Swarm port detection. The port can be any valid integer value.
    - "traefik.http.services.dummy-svc.loadbalancer.server.port=9999"

I copied your exact config and I cant get my traefik to work at all.

Hello @Daxcor

Glad to see that the issue is solved. Please consider also upgrading to the latest Traefik Version that is 2.5 - there are a lot of new features and bug fixes so upgrading seems to be worth managing.