SSL Issue/Auto-Renew With Docker
Issue/Renew SSL certificates using docker
we will be using webroot method to get certificates with certbot
Some Examples:
For Issuing New SSL
docker run \
-v /etc/nginx/conf.d/ssl/certbot:/etc/letsencrypt \
-v /usr/share/nginx/html:/usr/share/nginx/html \
-v /etc/nginx/conf.d/ssl/certbot:/etc/nginx/conf.d/ssl/certbot \
certbot/certbot \
certonly --webroot --webroot-path=/usr/share/nginx/html/ --non-interactive --register-unsafely-without-email --agree-tos -d helpace.app --cert-name helpace.app --config-dir /etc/nginx/conf.d/ssl/certbot
For Renew
docker run -i \
-v /etc/nginx/conf.d/ssl/certbot:/etc/letsencrypt \
-v /usr/share/nginx/html:/usr/share/nginx/html \
-v /etc/nginx/conf.d/ssl/certbot:/etc/nginx/conf.d/ssl/certbot \
certbot/certbot \
renew --dry-run --webroot --webroot-path=/usr/share/nginx/html/ --non-interactive --agree-tos --cert-name helpace.app --config-dir /etc/nginx/conf.d/ssl/certbot
We can also set cron to renew ssl
In above example we need to change some paramere are per need
EX. - volume mounting,
- webroot path,
- certname,
- domain name,
- config dir
Related Articles
OpenProject Docker
sudo mkdir -p /var/lib/openproject/{pgdata,logs,static} docker run -d -p 80:80 --restart always --name qam -e SECRET_KEY_BASE=very_secret_pass_as_secret_as_it_gets -e EMAIL_DELIVERY_METHOD=smtp -e SMTP_ADDRESS=smtp.sendgrid.net -e SMTP_PORT=587 -e ...
Installing Docker
Installing Docker On Windows Minimul Requirement : 1. Windows 10 64bit 2. At least 4GB of RAM. Steps: 1. Download exe from download.docker.com 2. Run the installer. 3. Start the docker. More Information ...
What & How : Docker commands
1. Install Docker $curl https://get.docker.com/ > dockerinstall && chmod 777 dockerinstall && ./dockerinstall 2. Docker should now be installed, the daemon started, and the process enabled to start on boot. Check that it's running: $service docker ...
Installing phpMyAdmin and MySQL via Docker In local
Prerequisite: 1. Basic Understanding of Docker and Container : If you haven't attend any Docker 101 webinars and seminars, ask your TL to arrange one. 2. Docker is installed : Ref : ...
Which : SSL Request Questions
Following details are required to Generate CSR : Common Name: The fully-qualified domain name, or URL, you're securing. If you are requesting a Wildcard certificate, add an asterisk (*) to the left of the common name where you want the wildcard, for ...