docker-smtp
docker-smtp copied to clipboard
Traefik integration
How can I integrate with Traefik for SSL and more?
Hi
Traefik proxies incoming connections,, not outgoing ones - but you can access the certs generated by Traefik.
#!/bin/sh
jq -r .YOURPROVIDER.Certificates[0].certificate /your/host/path/to/your/traefik/acme.json | base64 -d > /another/path/on/your/host/cert.pem
jq -r .YOURPROVIDER.Certificates[0].key /your/host/path/to/your/traefik/acme.json | base64 -d > /another/path/on/your/host//key.pem
I'm assuming that you
- have a volume you use for persistent Traefik storage, which contains acme.json
- have a different volume you can use to expose to namshi/smtp
- have "jq" installed (it's available to Debian)
I run this nightly as a cron job to extract my certs from Traefik and expose them to other services/containers that need them locally. You'd likely need to issue a docker restart to namshi/smtp also.