Docker swarmMode + other issue with Traefik v2.2.0

Having a bizarre problem where I enable swarm mode in Traefik v2.2.0 using the following command:

  - "--providers.docker.swarmMode=true"

It causes Traefik to fail completely (every url gives a page not found error).

Also, a side problem which may be related is how I managed to get the dashboard working. The only way which seemed to work is:

  - "traefik.enable=true"
  - "traefik.http.routers.api.rule=Host(`<site ip>`) && (PathPrefix(`/traefik`) || PathPrefix(`/api`))"
  - "traefik.http.routers.api.middlewares=strip-traefik"
  - "traefik.http.middlewares.strip-traefik.stripprefix.prefixes=/traefik"

Yet when I visit /traefik the URL that's shown is /traefik/dashboard.

I thought that the /traefik element is removed by stripprefix?

I'm using an Azure virtual machine which is only IP based, not sure if that's anything to do with it.

Thanks for any suggestions.

Requires labels to be nested under deploy: in a compose file.

The paths for the dashboard ind api have to be at /api/ and /dashboard/