Skip to content
This repository was archived by the owner on Jul 28, 2021. It is now read-only.

Commit 2f49847

Browse files
sopitzchschu
authored andcommitted
add cronjob to renew certs if necessary
1 parent acb058c commit 2f49847

File tree

3 files changed

+6
-1
lines changed

3 files changed

+6
-1
lines changed

Dockerfile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
11
FROM jwilder/nginx-proxy:0.2.0
22

3-
RUN apt-get update && apt-get install -y git && apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
3+
RUN apt-get update && apt-get install -y git cron vim && apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
4+
RUN systemctl enable cron
45
RUN cd / && git clone https://github.com/letsencrypt/letsencrypt
56

67
COPY etc /etc
78
COPY ssl.tmpl /app/
89
COPY createSSL.sh /
910
RUN chmod +x /createSSL.sh
1011
COPY Procfile /app/Procfile
12+
COPY cronfile /app/cronfile
13+
RUN crontab /app/cronfile

Procfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
nginx: nginx
22
confgen: docker-gen -watch -only-exposed -notify "nginx -s reload" /app/nginx.tmpl /etc/nginx/conf.d/default.conf
33
sslgen: docker-gen -watch -only-exposed -notify "/createSSL.sh" /app/ssl.tmpl /createSSL.sh
4+
cron: /usr/sbin/cron -f

cronfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
00 10 * * * docker-gen -only-exposed -notify "/createSSL.sh" /app/ssl.tmpl /createSSL.sh

0 commit comments

Comments
 (0)