Skip to content

Letsencrypt with our frontend

a-a-hofmann edited this page Aug 27, 2020 · 5 revisions
  1. Exec into container, install certbot and start it
docker-compose exec frontend sh
apk add certbot certbot-nginx
certbot certonly --nginx --register-unsafely-without-email --agree-tos -d alpm.io
  1. Accept, set hostname, etc
  2. After a while it will log this
IMPORTANT NOTES:
 - Congratulations! Your certificate and chain have been saved at:
   /etc/letsencrypt/live/<hostname>/fullchain.pem
   Your key file has been saved at:
   /etc/letsencrypt/live/<hostname>/privkey.pem
   Your cert will expire on 2020-01-09. To obtain a new or tweaked
   version of this certificate in the future, simply run certbot
   again. To non-interactively renew *all* of your certificates, run
   "certbot renew"
 - Your account credentials have been saved in your Certbot
   configuration directory at /etc/letsencrypt. You should make a
   secure backup of this folder now. This configuration directory will
   also contain certificates and private keys obtained by Certbot so
   making regular backups of this folder is ideal.
 - If you like Certbot, please consider supporting our work by:

   Donating to ISRG / Let's Encrypt:   https://letsencrypt.org/donate
   Donating to EFF:                    https://eff.org/donate-le

  1. Move cert + key to nginx folder on host
cd /etc/letsencrypt/archive/<hostname/
cp fullchain1.pem server.crt
cp privkey1.pem server.key
mv server.crt /etc/ssl/info1/server.crt
mv server.key /etc/ssl/info1/server.key
  1. Restart server

See also: https://geko.cloud/nginx-and-ssl-with-certbot-in-docker-alpine/