Some further information, I rebooted and on initial look all appears as if it might be working. However, when I go to vps02.mydomain.org.uk I get an error saying the certificate is not valid for the domain, and is only valid for e859..verylongnumber.traefik.default. Does that mean I have got a certificate but it is not registered for the correct domain?
Another thing that is confusing me is that in Portainer I see
so to see the traefik logs I have to use
traefik_traefik.2acu8otaoc2s4kjl1ovmlyyp0.x62dyeyr4ti04xfldawaaht9e
which is a bit of a pain. The start of the log shows
2020-04-30T13:35:31.535533523Z time="2020-04-30T13:35:31Z" level=info msg="Configuration loaded from flags."
2020-04-30T13:35:31.535606443Z time="2020-04-30T13:35:31Z" level=info msg="Traefik version 2.2.1 built on 2020-04-29T18:02:09Z"
2020-04-30T13:35:31.537006003Z time="2020-04-30T13:35:31Z" level=debug msg="Static configuration loaded {\"global\":{\"checkNewVersion\":true,\"sendAnonymousUsage\":true},\"serversTransport\":{\"maxIdleConnsPerHost\":200},\"entryPoints\":{\"web\":{\"address\":\":80\",\"transport\":{\"lifeCycle\":{\"graceTimeOut\":10000000000},\"respondingTimeouts\":{\"idleTimeout\":180000000000}},\"forwardedHeaders\":{},\"http\":{}},\"websecure\":{\"address\":\":443\",\"transport\":{\"lifeCycle\":{\"graceTimeOut\":10000000000},\"respondingTimeouts\":{\"idleTimeout\":180000000000}},\"forwardedHeaders\":{},\"http\":{}}},\"providers\":{\"providersThrottleDuration\":2000000000,\"docker\":{\"watch\":true,\"endpoint\":\"unix:///var/run/docker.sock\",\"defaultRule\":\"Host(`{{ normalize .Name }}`)\",\"swarmMode\":true,\"network\":\"traefik-public\",\"swarmModeRefreshSeconds\":15000000000},\"file\":{\"directory\":\"/etc\",\"watch\":true}},\"api\":{\"dashboard\":true},\"metrics\":{},\"log\":{\"level\":\"DEBUG\",\"format\":\"common\"},\"accessLog\":{\"filePath\":\"/var/log/docker/traefik.log\",\"format\":\"common\",\"filters\":{},\"fields\":{\"defaultMode\":\"keep\",\"headers\":{\"defaultMode\":\"drop\"}},\"bufferingSize\":100},\"certificatesResolvers\":{\"letsencryptresolver\":{\"acme\":{\"email\":\"me@mydomain.org.uk\",\"caServer\":\"https://acme-staging-v02.api.letsencrypt.org/directory\",\"storage\":\"/letsencrypt/acme.json\",\"keyType\":\"RSA4096\",\"dnsChallenge\":{\"provider\":\"cloudflare\",\"delayBeforeCheck\":90000000000,\"resolvers\":[\"1.1.1.1:53\",\"1.0.0.1:53\"]}}}}}"
2020-04-30T13:35:31.537074234Z time="2020-04-30T13:35:31Z" level=info msg="Stats collection is enabled."
2020-04-30T13:35:31.537083040Z time="2020-04-30T13:35:31Z" level=info msg="Many thanks for contributing to Traefik's improvement by allowing us to receive anonymous information from your configuration."
2020-04-30T13:35:31.537090821Z time="2020-04-30T13:35:31Z" level=info msg="Help us improve Traefik by leaving this feature on :)"
2020-04-30T13:35:31.537097849Z time="2020-04-30T13:35:31Z" level=info msg="More details on: https://docs.traefik.io/contributing/data-collection/"
2020-04-30T13:35:31.638609161Z time="2020-04-30T13:35:31Z" level=debug msg="Start TCP Server" entryPointName=websecure
2020-04-30T13:35:31.638654796Z time="2020-04-30T13:35:31Z" level=info msg="Starting provider aggregator.ProviderAggregator {}"
2020-04-30T13:35:31.638671793Z time="2020-04-30T13:35:31Z" level=debug msg="Start TCP Server" entryPointName=web
2020-04-30T13:35:31.638760990Z time="2020-04-30T13:35:31Z" level=info msg="Starting provider *file.Provider {\"directory\":\"/etc\",\"watch\":true}"
2020-04-30T13:35:31.740196820Z time="2020-04-30T13:35:31Z" level=info msg="Starting provider *docker.Provider {\"watch\":true,\"endpoint\":\"unix:///var/run/docker.sock\",\"defaultRule\":\"Host(`{{ normalize .Name }}`)\",\"swarmMode\":true,\"network\":\"traefik-public\",\"swarmModeRefreshSeconds\":15000000000}"
2020-04-30T13:35:31.740256553Z time="2020-04-30T13:35:31Z" level=info msg="Starting provider *traefik.Provider {}"
2020-04-30T13:35:31.740268719Z time="2020-04-30T13:35:31Z" level=info msg="Starting provider *acme.Provider {\"email\":\"me@mydomain.org.uk\",\"caServer\":\"https://acme-staging-v02.api.letsencrypt.org/directory\",\"storage\":\"/letsencrypt/acme.json\",\"keyType\":\"RSA4096\",\"dnsChallenge\":{\"provider\":\"cloudflare\",\"delayBeforeCheck\":90000000000,\"resolvers\":[\"1.1.1.1:53\",\"1.0.0.1:53\"]},\"ResolverName\":\"letsencryptresolver\",\"store\":{},\"ChallengeStore\":{}}"
2020-04-30T13:35:31.740281092Z time="2020-04-30T13:35:31Z" level=info msg="Testing certificate renew..." providerName=letsencryptresolver.acme
2020-04-30T13:35:31.741417989Z time="2020-04-30T13:35:31Z" level=debug msg="Configuration received from provider file: {\"http\":{},\"tcp\":{},\"udp\":{},\"tls\":{}}" providerName=file
2020-04-30T13:35:31.741775968Z time="2020-04-30T13:35:31Z" level=debug msg="Configuration received from provider internal: {\"http\":{\"services\":{\"api\":{},\"dashboard\":{},\"noop\":{}}},\"tcp\":{},\"tls\":{}}" providerName=internal
2020-04-30T13:35:31.756531602Z time="2020-04-30T13:35:31Z" level=debug msg="Configuration received from provider letsencryptresolver.acme: {\"http\":{},\"tls\":{}}" providerName=letsencryptresolver.acme
2020-04-30T13:35:31.774234887Z time="2020-04-30T13:35:31Z" level=debug msg="No default certificate, generating one"
2020-04-30T13:35:31.839146632Z time="2020-04-30T13:35:31Z" level=debug msg="Provider connection established with docker 19.03.8 (API 1.40)" providerName=docker
2020-04-30T13:35:31.865788824Z time="2020-04-30T13:35:31Z" level=debug msg="Network not found, id: s79msp9gdl2xbppxdk0bfhudx" providerName=docker
2020-04-30T13:35:31.867280749Z time="2020-04-30T13:35:31Z" level=debug msg="Filtering disabled container" providerName=docker container=traefik-traefik-x62dyeyr4ti04xfldawaaht9e
2020-04-30T13:35:31.867417388Z time="2020-04-30T13:35:31Z" level=debug msg="Configuration received from provider docker: {\"http\":{},\"tcp\":{},\"udp\":{}}" providerName=docker
2020-04-30T13:35:32.007376409Z time="2020-04-30T13:35:32Z" level=debug msg="No default certificate, generating one"
2020-04-30T13:35:32.339703544Z time="2020-04-30T13:35:32Z" level=debug msg="No default certificate, generating one"
2020-04-30T13:35:33.034959401Z time="2020-04-30T13:35:33Z" level=debug msg="No default certificate, generating one"
2020-04-30T13:35:46.910432524Z time="2020-04-30T13:35:46Z" level=debug msg="Network not found, id: s79msp9gdl2xbppxdk0bfhudx" providerName=docker
2020-04-30T13:35:46.912187737Z time="2020-04-30T13:35:46Z" level=debug msg="Filtering disabled container" providerName=docker container=traefik-traefik-x62dyeyr4ti04xfldawaaht9e
2020-04-30T13:35:46.912266491Z time="2020-04-30T13:35:46Z" level=debug msg="Configuration received from provider docker: {\"http\":{},\"tcp\":{},\"udp\":{}}" providerName=docker
2020-04-30T13:35:46.912410351Z time="2020-04-30T13:35:46Z" level=info msg="Skipping same configuration" providerName=docker
2020-04-30T13:36:01.910137097Z time="2020-04-30T13:36:01Z" level=debug msg="Network not found, id: s79msp9gdl2xbppxdk0bfhudx" providerName=docker
2020-04-30T13:36:01.912000222Z time="2020-04-30T13:36:01Z" level=debug msg="Filtering disabled container" providerName=docker container=traefik-traefik-x62dyeyr4ti04xfldawaaht9e
2020-04-30T13:36:01.912058212Z time="2020-04-30T13:36:01Z" level=debug msg="Configuration received from provider docker: {\"http\":{},\"tcp\":{},\"udp\":{}}" providerName=docker
2020-04-30T13:36:01.912129686Z time="2020-04-30T13:36:01Z" level=info msg="Skipping same configuration" providerName=docker
Possibly the certificate problem is related to the No default certificate, generating one
messages which rather suggests to me that I am not getting a certificate.
The last four messages are repeated every 15 seconds, but I don't know whether they are errors or not.