dockerswarm.rocks
dockerswarm.rocks copied to clipboard
Custom SSL Certificate
It would be very useful to have a chapter that explains how to configure a custom wildcard type certificate. Tanks.
Thanks for the patience!
I should let you know, I had to deprecate this website and ideas, I would no longer recommend Docker Swarm Mode for new projects: https://dockerswarm.rocks/swarm-or-kubernetes/ 🥲
My solution for custom wildcard certificates was to mount two volumes in the traefik container, one to read a dynamic configuration file and one to read the certificates stored locally:
command:
- --providers.file.directory=/etc/traefik/
- --providers.file.watch=true
volumes:
- "./config/dynamic.yml:/etc/traefik/dynamic.yml:ro"
- "./certs:/etc/certs:ro"
Dynamic.yml
tls:
certificates:
- certFile: "/etc/certs/local-cert.pem"
keyFile: "/etc/certs/local-key.pem"
If there's issues with deploying the custom certificates, check the docker logs for the traefik container, as traefik will fallback to the default (inbuilt) certificates if there's a problem.