I am using nginx as proxy and SSL termination for the site hosted on docker. App & nginx both are on docker. I have installed Let's encrypt SSL using Certbot directly on Ubuntu server. And now using the SSL cert installed on Ubuntu server in Docker by mapping it using volume in docker-compose.
I noticed that Certbot cron job to renew certificate is failing as the port 80 and 443 are in use by docker nginx instance.
And to renew, I need to stop the docker and then run certbot renew command which works fine.
What is the best way to have automated renewal without stopping docker container that runs nginx.