add certbot

This commit is contained in:
Ludovic CANDELLIER
2024-01-22 23:05:39 +01:00
parent 1677ec6b03
commit fbe9633651
2 changed files with 19 additions and 0 deletions

10
docker/certbot/Dockerfile Executable file
View File

@@ -0,0 +1,10 @@
FROM phusion/baseimage:bionic-1.0.0
LABEL maintainer="Ludovic CANDELLIER <ludovic.candellier@fundglobam.com>"
COPY run-certbot.sh /root/certbot/run-certbot.sh
RUN apt-get update
RUN apt-get install -y letsencrypt
ENTRYPOINT bash -c "bash /root/certbot/run-certbot.sh && sleep infinity"

9
docker/certbot/run-certbot.sh Executable file
View File

@@ -0,0 +1,9 @@
#!/bin/bash
letsencrypt certonly --webroot -w /var/www/letsencrypt -d "$CN" --agree-tos --email "$EMAIL" --non-interactive --text
cp /etc/letsencrypt/archive/"$CN"/cert1.pem /var/certs/"$CN"-cert1.pem
cp /etc/letsencrypt/archive/"$CN"/chain1.pem /var/certs/chain1.pem
cp /etc/letsencrypt/archive/"$CN"/fullchain1.pem /var/certs/fullchain1.pem
cp /etc/letsencrypt/archive/"$CN"/privkey1.pem /var/certs/"$CN"-privkey1.pem