I had a chance to try the suggestion from @bluepuma77 It has fewer errors, but both browsers (Chrome & Firefox) make the user walk through those "are you sure?" insecure website warnings, and then the padlock icon indicates insecurity.
Here's the current docker compose, in case I did something incorrect:
(I'll include the Traefik log beneath this.)
version: "3.3"
networks:
web:
external: true
internal:
name: internal
external: false
agent_network:
name: agent_network
driver: overlay
driver_opts:
com.docker.network.driver.mtu: 1400
attachable: true
proxy:
external: true
services:
traefik:
image: "traefik:v3.0"
container_name: "traefik"
command:
- "--log.level=DEBUG"
- "--api.insecure=true"
- "--providers.docker=true"
- "--providers.docker.exposedbydefault=false"
- "--providers.docker.network=web"
- "--entrypoints.websecure.address=:443"
- "--entrypoints.web.address=:80"
- "--certificatesresolvers.myresolver.tailscale=true"
ports:
- "80:80"
- "443:443"
- "8080:8080"
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
- /var/run/tailscale/tailscaled.sock:/var/run/tailscale/tailscaled.sock
networks:
- web
- internal
web:
build: ./src
container_name: "web"
command: |
bash -c 'while !</dev/tcp/db/5432; do sleep 1; done; uvicorn app.main:app --reload --workers 4 --host 0.0.0.0 --port 8000'
labels:
- traefik.enable=true
- traefik.http.routers.web.rule=Host(`machineName.magicDNSName.ts.net`)
- traefik.http.routers.web.tls.certresolver=myresolver
- traefik.http.services.web.loadbalancer.server.port=8000
- traefik.http.routers.web.entrypoints=websecure
volumes:
- ./src/:/home/app/web
# ports:
# hostPort:containerPort
# - 8000:8000
environment:
- DATABASE_URL=postgresql://*****:**********@db/*********
networks:
- web
- internal
db:
# image: "postgres:latest"
image: postgres:13-alpine
container_name: "postgres"
volumes:
- postgres_data:/var/lib/postgresql/data/
expose:
- 5432
environment:
- POSTGRES_USER=*****
- POSTGRES_PASSWORD=**********
- POSTGRES_DB=*********
networks:
- internal
volumes:
postgres_data:
Here is the Traefik log:
2023-04-17 16:46:13 2023-04-17T22:46:13Z INF github.com/traefik/traefik/v2/cmd/traefik/traefik.go:100 > Traefik version 3.0.0-beta2 built on 2022-12-07T16:32:34Z version=3.0.0-beta2
2023-04-17 16:46:13 2023-04-17T22:46:13Z DBG github.com/traefik/traefik/v2/cmd/traefik/traefik.go:107 > Static configuration loaded [json] staticConfiguration={"api":{"dashboard":true,"insecure":true},"certificatesResolvers":{"myresolver":{"tailscale":{}}},"entryPoints":{"traefik":{"address":":8080","forwardedHeaders":{},"http":{},"http2":{"maxConcurrentStreams":250},"transport":{"lifeCycle":{"graceTimeOut":"10s"},"respondingTimeouts":{"idleTimeout":"3m0s"}},"udp":{"timeout":"3s"}},"web":{"address":":80","forwardedHeaders":{},"http":{},"http2":{"maxConcurrentStreams":250},"transport":{"lifeCycle":{"graceTimeOut":"10s"},"respondingTimeouts":{"idleTimeout":"3m0s"}},"udp":{"timeout":"3s"}},"websecure":{"address":":443","forwardedHeaders":{},"http":{},"http2":{"maxConcurrentStreams":250},"transport":{"lifeCycle":{"graceTimeOut":"10s"},"respondingTimeouts":{"idleTimeout":"3m0s"}},"udp":{"timeout":"3s"}}},"global":{"checkNewVersion":true},"log":{"format":"common","level":"DEBUG"},"providers":{"docker":{"defaultRule":"Host(`{{ normalize .Name }}`)","endpoint":"unix:///var/run/docker.sock","network":"web","swarmModeRefreshSeconds":"15s","watch":true},"providersThrottleDuration":"2s"},"serversTransport":{"maxIdleConnsPerHost":200}}
2023-04-17 16:46:13 2023-04-17T22:46:13Z INF github.com/traefik/traefik/v2/cmd/traefik/traefik.go:685 >
2023-04-17 16:46:13 Stats collection is disabled.
2023-04-17 16:46:13 Help us improve Traefik by turning this feature on :)
2023-04-17 16:46:13 More details on: https://doc.traefik.io/traefik/contributing/data-collection/
2023-04-17 16:46:13
2023-04-17 16:46:13 2023-04-17T22:46:13Z INF github.com/traefik/traefik/v2/pkg/server/configurationwatcher.go:72 > Starting provider aggregator aggregator.ProviderAggregator
2023-04-17 16:46:13 2023-04-17T22:46:13Z DBG github.com/traefik/traefik/v2/pkg/server/server_entrypoint_tcp.go:188 > Starting TCP Server entryPointName=traefik
2023-04-17 16:46:13 2023-04-17T22:46:13Z DBG github.com/traefik/traefik/v2/pkg/server/server_entrypoint_tcp.go:188 > Starting TCP Server entryPointName=websecure
2023-04-17 16:46:13 2023-04-17T22:46:13Z DBG github.com/traefik/traefik/v2/pkg/server/server_entrypoint_tcp.go:188 > Starting TCP Server entryPointName=web
2023-04-17 16:46:13 2023-04-17T22:46:13Z INF github.com/traefik/traefik/v2/pkg/provider/aggregator/aggregator.go:207 > Starting provider *traefik.Provider
2023-04-17 16:46:13 2023-04-17T22:46:13Z INF github.com/traefik/traefik/v2/pkg/provider/aggregator/aggregator.go:207 > Starting provider *docker.Provider
2023-04-17 16:46:13 2023-04-17T22:46:13Z DBG github.com/traefik/traefik/v2/pkg/provider/aggregator/aggregator.go:208 > *traefik.Provider provider configuration config={}
2023-04-17 16:46:13 2023-04-17T22:46:13Z DBG github.com/traefik/traefik/v2/pkg/provider/aggregator/aggregator.go:208 > *docker.Provider provider configuration config={"defaultRule":"Host(`{{ normalize .Name }}`)","endpoint":"unix:///var/run/docker.sock","network":"web","swarmModeRefreshSeconds":"15s","watch":true}
2023-04-17 16:46:13 2023-04-17T22:46:13Z INF github.com/traefik/traefik/v2/pkg/provider/aggregator/aggregator.go:207 > Starting provider *acme.ChallengeTLSALPN
2023-04-17 16:46:13 2023-04-17T22:46:13Z INF github.com/traefik/traefik/v2/pkg/provider/aggregator/aggregator.go:207 > Starting provider *tailscale.Provider
2023-04-17 16:46:13 2023-04-17T22:46:13Z DBG github.com/traefik/traefik/v2/pkg/provider/aggregator/aggregator.go:208 > *acme.ChallengeTLSALPN provider configuration config={}
2023-04-17 16:46:13 2023-04-17T22:46:13Z DBG github.com/traefik/traefik/v2/pkg/provider/aggregator/aggregator.go:208 > *tailscale.Provider provider configuration config={"ResolverName":"myresolver"}
2023-04-17 16:46:13 2023-04-17T22:46:13Z DBG github.com/traefik/traefik/v2/pkg/server/configurationwatcher.go:217 > Configuration received config={"http":{"middlewares":{"dashboard_redirect":{"redirectRegex":{"permanent":true,"regex":"^(http:\\/\\/(\\[[\\w:.]+\\]|[\\w\\._-]+)(:\\d+)?)\\/$","replacement":"${1}/dashboard/"}},"dashboard_stripprefix":{"stripPrefix":{"prefixes":["/dashboard/","/dashboard"]}}},"routers":{"api":{"entryPoints":["traefik"],"priority":2147483646,"rule":"PathPrefix(`/api`)","service":"api@internal"},"dashboard":{"entryPoints":["traefik"],"middlewares":["dashboard_redirect@internal","dashboard_stripprefix@internal"],"priority":2147483645,"rule":"PathPrefix(`/`)","service":"dashboard@internal"}},"serversTransports":{"default":{"maxIdleConnsPerHost":200}},"services":{"api":{},"dashboard":{},"noop":{}}},"tcp":{},"tls":{},"udp":{}} providerName=internal
2023-04-17 16:46:13 2023-04-17T22:46:13Z DBG github.com/traefik/traefik/v2/pkg/provider/docker/docker.go:217 > Provider connection established with docker 20.10.22 (API 1.41) providerName=docker
2023-04-17 16:46:13 2023-04-17T22:46:13Z DBG github.com/traefik/traefik/v2/pkg/provider/docker/config.go:173 > Filtering disabled container container=traefik-minicms-6d3e4774a24985bd04a699711c523ba3935b89249bec0cd80774b4afeb9694b0 providerName=docker
2023-04-17 16:46:13 2023-04-17T22:46:13Z DBG github.com/traefik/traefik/v2/pkg/provider/docker/config.go:173 > Filtering disabled container container=db-minicms-8bec759eb4f7d44601ade5e185a5d52765642b1fdd0e714c821554746cbeb849 providerName=docker
2023-04-17 16:46:13 2023-04-17T22:46:13Z DBG github.com/traefik/traefik/v2/pkg/server/configurationwatcher.go:217 > Configuration received config={"http":{"routers":{"web":{"entryPoints":["websecure"],"rule":"Host(`machineName.MagicDNSName.ts.net`)","service":"web","tls":{"certResolver":"myresolver"}}},"services":{"web":{"loadBalancer":{"passHostHeader":true,"responseForwarding":{"flushInterval":"100ms"},"servers":[{"url":"http://172.20.0.2:8000"}]}}}},"tcp":{},"udp":{}} providerName=docker
2023-04-17 16:46:14 2023-04-17T22:46:14Z DBG github.com/traefik/traefik/v2/pkg/tls/tlsmanager.go:294 > No default certificate, fallback to the internal generated certificate tlsStoreName=default
2023-04-17 16:46:14 2023-04-17T22:46:14Z DBG github.com/traefik/traefik/v2/pkg/middlewares/tracing/forwarder.go:26 > Added outgoing tracing middleware entryPointName=traefik middlewareName=tracing middlewareType=TracingForwarder routerName=api@internal serviceName=api@internal
2023-04-17 16:46:14 2023-04-17T22:46:14Z DBG github.com/traefik/traefik/v2/pkg/middlewares/tracing/forwarder.go:26 > Added outgoing tracing middleware entryPointName=traefik middlewareName=tracing middlewareType=TracingForwarder routerName=dashboard@internal serviceName=dashboard@internal
2023-04-17 16:46:14 2023-04-17T22:46:14Z DBG github.com/traefik/traefik/v2/pkg/middlewares/stripprefix/strip_prefix.go:29 > Creating middleware entryPointName=traefik middlewareName=dashboard_stripprefix@internal middlewareType=StripPrefix routerName=dashboard@internal
2023-04-17 16:46:14 2023-04-17T22:46:14Z DBG github.com/traefik/traefik/v2/pkg/middlewares/tracing/wrapper.go:32 > Adding tracing to middleware entryPointName=traefik middlewareName=dashboard_stripprefix@internal routerName=dashboard@internal
2023-04-17 16:46:14 2023-04-17T22:46:14Z DBG github.com/traefik/traefik/v2/pkg/middlewares/redirect/redirect_regex.go:17 > Creating middleware entryPointName=traefik middlewareName=dashboard_redirect@internal middlewareType=RedirectRegex routerName=dashboard@internal
2023-04-17 16:46:14 2023-04-17T22:46:14Z DBG github.com/traefik/traefik/v2/pkg/middlewares/redirect/redirect_regex.go:18 > Setting up redirection from ^(http:\/\/(\[[\w:.]+\]|[\w\._-]+)(:\d+)?)\/$ to ${1}/dashboard/ entryPointName=traefik middlewareName=dashboard_redirect@internal middlewareType=RedirectRegex routerName=dashboard@internal
2023-04-17 16:46:14 2023-04-17T22:46:14Z DBG github.com/traefik/traefik/v2/pkg/middlewares/tracing/wrapper.go:32 > Adding tracing to middleware entryPointName=traefik middlewareName=dashboard_redirect@internal routerName=dashboard@internal
2023-04-17 16:46:14 2023-04-17T22:46:14Z DBG github.com/traefik/traefik/v2/pkg/middlewares/recovery/recovery.go:22 > Creating middleware entryPointName=traefik middlewareName=traefik-internal-recovery middlewareType=Recovery
2023-04-17 16:46:14 2023-04-17T22:46:14Z DBG github.com/traefik/traefik/v2/pkg/tls/tlsmanager.go:294 > No default certificate, fallback to the internal generated certificate tlsStoreName=default
2023-04-17 16:46:14 2023-04-17T22:46:14Z DBG github.com/traefik/traefik/v2/pkg/middlewares/tracing/forwarder.go:26 > Added outgoing tracing middleware entryPointName=traefik middlewareName=tracing middlewareType=TracingForwarder routerName=api@internal serviceName=api@internal
2023-04-17 16:46:14 2023-04-17T22:46:14Z DBG github.com/traefik/traefik/v2/pkg/middlewares/tracing/forwarder.go:26 > Added outgoing tracing middleware entryPointName=traefik middlewareName=tracing middlewareType=TracingForwarder routerName=dashboard@internal serviceName=dashboard@internal
2023-04-17 16:46:14 2023-04-17T22:46:14Z DBG github.com/traefik/traefik/v2/pkg/middlewares/stripprefix/strip_prefix.go:29 > Creating middleware entryPointName=traefik middlewareName=dashboard_stripprefix@internal middlewareType=StripPrefix routerName=dashboard@internal
2023-04-17 16:46:14 2023-04-17T22:46:14Z DBG github.com/traefik/traefik/v2/pkg/middlewares/tracing/wrapper.go:32 > Adding tracing to middleware entryPointName=traefik middlewareName=dashboard_stripprefix@internal routerName=dashboard@internal
2023-04-17 16:46:14 2023-04-17T22:46:14Z DBG github.com/traefik/traefik/v2/pkg/middlewares/redirect/redirect_regex.go:17 > Creating middleware entryPointName=traefik middlewareName=dashboard_redirect@internal middlewareType=RedirectRegex routerName=dashboard@internal
2023-04-17 16:46:14 2023-04-17T22:46:14Z DBG github.com/traefik/traefik/v2/pkg/middlewares/redirect/redirect_regex.go:18 > Setting up redirection from ^(http:\/\/(\[[\w:.]+\]|[\w\._-]+)(:\d+)?)\/$ to ${1}/dashboard/ entryPointName=traefik middlewareName=dashboard_redirect@internal middlewareType=RedirectRegex routerName=dashboard@internal
2023-04-17 16:46:14 2023-04-17T22:46:14Z DBG github.com/traefik/traefik/v2/pkg/middlewares/tracing/wrapper.go:32 > Adding tracing to middleware entryPointName=traefik middlewareName=dashboard_redirect@internal routerName=dashboard@internal
2023-04-17 16:46:14 2023-04-17T22:46:14Z DBG github.com/traefik/traefik/v2/pkg/middlewares/recovery/recovery.go:22 > Creating middleware entryPointName=traefik middlewareName=traefik-internal-recovery middlewareType=Recovery
2023-04-17 16:46:14 2023-04-17T22:46:14Z DBG github.com/traefik/traefik/v2/pkg/server/service/service.go:256 > Creating load-balancer entryPointName=websecure routerName=web@docker serviceName=web@docker
2023-04-17 16:46:14 2023-04-17T22:46:14Z DBG github.com/traefik/traefik/v2/pkg/server/service/service.go:298 > Creating server entryPointName=websecure routerName=web@docker serverName=82a992d8b7725f97 serviceName=web@docker target=http://172.20.0.2:8000
2023-04-17 16:46:14 2023-04-17T22:46:14Z DBG github.com/traefik/traefik/v2/pkg/middlewares/tracing/forwarder.go:26 > Added outgoing tracing middleware entryPointName=websecure middlewareName=tracing middlewareType=TracingForwarder routerName=web@docker serviceName=web
2023-04-17 16:46:14 2023-04-17T22:46:14Z DBG github.com/traefik/traefik/v2/pkg/middlewares/recovery/recovery.go:22 > Creating middleware entryPointName=websecure middlewareName=traefik-internal-recovery middlewareType=Recovery
2023-04-17 16:46:14 2023-04-17T22:46:14Z DBG github.com/traefik/traefik/v2/pkg/server/router/tcp/manager.go:235 > Adding route for machineName.MagicDNSName.ts.net with TLS options default entryPointName=websecure
2023-04-17 16:46:15 2023-04-17T22:46:15Z ERR github.com/traefik/traefik/v2/pkg/provider/tailscale/provider.go:249 > Unable to fetch certificate for domain "machineName.MagicDNSName.ts.net" error="Get \"http://local-tailscaled.sock/localapi/v0/cert/machineName.MagicDNSName.ts.net?type=pair\": dial unix /var/run/tailscale/tailscaled.sock: connect: connection refused" providerName=myresolver.tailscale
2023-04-17 16:46:15 2023-04-17T22:46:15Z DBG github.com/traefik/traefik/v2/pkg/server/configurationwatcher.go:118 > Skipping empty configuration providerName=myresolver.tailscale
2023-04-17 16:50:50 2023-04-17T22:50:50Z DBG github.com/traefik/traefik/v2/pkg/tls/tlsmanager.go:220 > Serving default certificate for request: "machineName.MagicDNSName.ts.net"
2023-04-17 16:50:50 2023-04-17T22:50:50Z DBG log/log.go:198 > http: TLS handshake error from 172.18.0.1:46512: remote error: tls: unknown certificate
2023-04-17 16:51:01 2023-04-17T22:51:01Z DBG github.com/traefik/traefik/v2/pkg/tls/tlsmanager.go:220 > Serving default certificate for request: "machineName.MagicDNSName.ts.net"
2023-04-17 16:51:01 2023-04-17T22:51:01Z DBG log/log.go:198 > http: TLS handshake error from 172.18.0.1:46514: remote error: tls: unknown certificate
2023-04-17 16:51:01 2023-04-17T22:51:01Z DBG github.com/traefik/traefik/v2/pkg/tls/tlsmanager.go:220 > Serving default certificate for request: "machineName.MagicDNSName.ts.net"
2023-04-17 16:51:01 2023-04-17T22:51:01Z DBG github.com/traefik/traefik/v2/pkg/server/service/loadbalancer/wrr/wrr.go:173 > Service selected by WRR: 82a992d8b7725f97
2023-04-17 16:51:01 2023-04-17T22:51:01Z DBG github.com/traefik/traefik/v2/pkg/server/service/loadbalancer/wrr/wrr.go:173 > Service selected by WRR: 82a992d8b7725f97
2023-04-17 16:51:01 2023-04-17T22:51:01Z DBG github.com/traefik/traefik/v2/pkg/server/service/loadbalancer/wrr/wrr.go:173 > Service selected by WRR: 82a992d8b7725f97
2023-04-17 16:51:01 2023-04-17T22:51:01Z DBG github.com/traefik/traefik/v2/pkg/server/service/loadbalancer/wrr/wrr.go:173 > Service selected by WRR: 82a992d8b7725f97
2023-04-17 16:51:01 2023-04-17T22:51:01Z DBG github.com/traefik/traefik/v2/pkg/server/service/loadbalancer/wrr/wrr.go:173 > Service selected by WRR: 82a992d8b7725f97
Any ideas?