Hey,
I've been trying to make SSL Certs working for a moment on my applications but it does not...
Here is my docker-compose.yml :
version: "3.3"
services:
traefik:
image: "traefik:v2.0.0"
command:
- --entrypoints.web.address=:80
- --entrypoints.websecure.address=:443
- --providers.docker
- --api
- --certificatesresolvers.leresolver.acme.caserver=https://acme-staging-v02.api.letsencrypt.org/directory
- --certificatesresolvers.leresolver.acme.email=your@email.com
- --certificatesresolvers.leresolver.acme.storage=/letsencrypt/acme.json
- --certificatesresolvers.leresolver.acme.tlschallenge=true
- --log.level=DEBUG
- --log.format=json
- --accessLog
ports:
- "80:80"
- "443:443"
networks:
- web
volumes:
- "/var/run/docker.sock:/var/run/docker.sock:ro"
- "/opt/traefik/acme.json:/acme.json"
- "/opt/letsencrypt:/letsencrypt"
labels:
# Dashboard
- "traefik.http.routers.traefik.rule=Host(`traefik.example.com`)"
- "traefik.http.routers.traefik.service=api@internal"
- "traefik.http.routers.traefik.tls.certresolver=leresolver"
- "traefik.http.routers.traefik.entrypoints=websecure"
- "traefik.http.routers.traefik.middlewares=authtraefik"
- "traefik.http.middlewares.authtraefik.basicauth.users=user:$$apr1$$q8eZFHjF$$Fvmkk//V6Btlaf2i/ju5n/" # user/password
# 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"
networks:
web:
external: true
The acme.json file :
{
"leresolver": {
"Account": {
"Email": "your@email.com",
"Registration": {
"body": {
"status": "valid",
"contact": [
"mailto:your@email.com"
]
},
"uri": "https://acme-staging-v02.api.letsencrypt.org/acme/acct/15570204"
},
"PrivateKey": "privatekey",
"KeyType": "4096"
},
"Certificates": [
{
"domain": {
"main": "whoami.example.com"
},
"certificate": "certificate",
"key": "key",
"Store": "default"
},
{
"domain": {
"main": "traefik.example.com"
},
"certificate": "certificate",
"key": "key",
"Store": "default"
},
{
"domain": {
"main": ".example.com"
},
"certificate": "certificate",
"key": "key",
"Store": "default"
}
]
}
And there is no logs in the container concerning certs
Hope you can help me working this out !
Thanks.