The configuration below worked fine until I moved the location of the docker-compose.yml file. Now I got the invalid certificate message in the browser "This CA Root certificate is not trusted because it is not in the Trusted Root Certification Authorities store." for the self-signed certificate. Not sure what is causing the problem.
services:
traefik:
image: "traefik:v2.0.2"
container_name: "traefik"
command:
- "--entrypoints.web.address=:80"
- "--entryPoints.websecure.address=:443"
- "--api"
- "--providers.docker"
- "--certificatesResolvers.le-resolver.acme.email=test@nodomain.com"
- "--certificatesResolvers.le-resolver.acme.storage=acme.json"
- "--certificatesResolvers.le-resolver.acme.httpChallenge.entryPoint=web"
labels:
# global redirect to https
- "traefik.http.routers.http-catchall.rule=hostregexp(`{host:.+}`)"
- "traefik.http.routers.http-catchall.entrypoints=web"
- "traefik.http.routers.http-catchall.middlewares=redirect-to-https"
# middleware redirect
- "traefik.http.middlewares.redirect-to-https.redirectscheme.scheme=https"
ports:
- "80:80"
- "443:443"
- "8080:8080"
volumes:
- "/var/run/docker.sock:/var/run/docker.sock:ro"
- "./data/acme.json:/acme.json"