From c63739ec4250a03b5494e0d79a320befe0f7a8a2 Mon Sep 17 00:00:00 2001 From: Deon George Date: Mon, 20 Nov 2017 17:01:00 +1100 Subject: [PATCH] Added weekly cron to auto renew certbot --- Dockerfile | 3 +++ renew.sh | 3 +++ 2 files changed, 6 insertions(+) create mode 100755 renew.sh diff --git a/Dockerfile b/Dockerfile index 042bb74..07cd4d8 100644 --- a/Dockerfile +++ b/Dockerfile @@ -10,6 +10,9 @@ RUN yum -y install certbot nginx ln-nginx && yum clean all EXPOSE 80 443 +COPY renew.sh /usr/local/sbin +LABEL cron.weekly root:/usr/local/sbin/renew.sh + # Expose our web root and log directories log. #VOLUME [ "/etc/nginx/conf.d", "/etc/nginx/default.d" ] diff --git a/renew.sh b/renew.sh new file mode 100755 index 0000000..ac7bd18 --- /dev/null +++ b/renew.sh @@ -0,0 +1,3 @@ +#!/bin/sh + +certbot renew -q --config-dir /etc/nginx/conf.d/ssl/letsencrypt/ --renew-hook "kill 1"