How to Configure Traefik to Use Existing TLS Certificates
- Create a new file
tls.yml
tls:
stores:
default:
defaultCertificate:
certFile: /etc/traefik/certs/your-domain.dev/cert.pem
keyFile: /etc/traefik/certs/your-domain.dev/privkey.pem
- Make sure you're copying this file in your
Dockerfile
COPY .docker/traefik/conf.d/tls.yml /etc/traefik/tls.yml
- Mount the
certs
folder in yourdocker-compose.yml
file
volumes:
...
- .docker/traefik/certs:/etc/traefik/certs
...
- Update the
traefik.yml
config to support thefile
provider:
providers:
...
file:
filename: "/etc/traefik/tls.yml
...