How to handle AutoSSL updates with docker

Hi,
I have a server with drone.io CI (docker container), as well as Apache(without docker).
I’m mounting SSL key and cert, so the drone can handle HTTPS.
The problem is that every 3 months, AutoSSL creates a new cert/key files, and saves the files with a different name, so I need to rename the files manualy/ cron job that checks it every X hours.

Maybe any of you know a better way to handle this issue?

Thanks

What is AutoSSL?

If the CI server is accessible from the internet, you could put a letsencrypt capable reverse proxy container in front of it and let it take care of the creation and update of letsencrypt certificates. I can highly recommend traefik for this.

AutoSSL is a tool that creates new cert/key SSL files when the old ones are about to expire.
This tool comes with cPanel (web hosting control panel).

I think letsencrypt can only be used with ports 80/443, but as I’ve mentioned, I have Apache on the server, so these ports are used by Apache, and I’m using ports 8080/8443 for the drone.

In order to use the SSL files I’m running:

docker run
–volume=/path/to/ssl/cert:/path/to/ssl/cert
–volume=/path/to/ssl/key:/path/to/ssl/key


–publish=8080:80
–publish=8443:443 \

So the problem is that when AutoSSL generates new cert/key files, the files under volume paths expires…
I can fix it by running a Cron job to check and move old files, but I’m looking for a better way.

Maybe there is a way to insert a path to a script that will echo the cert files in “volume”?
I’ve tried to insert there a bash script, I got no errors, but could not reach the drone from browser with https.
Thanks

I found a combined file with the most new cert/key files.
Thanks anyway.