Added start of nginx config

pull/3/head
Jef Roosens 2021-01-04 12:38:27 +01:00
parent f6d28afda0
commit 91378a9cf1
5 changed files with 25 additions and 0 deletions

View File

0
nginx/README.md 100644
View File

View File

@ -0,0 +1,14 @@
FROM nginx:stable-alpine
RUN apk add --no-cache certbot
COPY entrypoint.sh ./entrypoint.sh
RUN chmod +x ./entrypoint.sh
RUN mkdir /var/lib/certbot
COPY renew /etc/periodic/weekly/renew
RUN chmod +x /etc/periodic/weekly/renew
RUN /usr/sbin/crond -f -d 8 &
ENTRYPOINT [ "./entrypoint.sh" ]

View File

@ -0,0 +1,8 @@
#!/usr/bin/env sh
# Should be passed as env vars
# DOMAINS=suzy.roosens.me,next.roosens.me,tm.roosens.me
# EMAIL=roosensjef@gmail.com
certbot certonly --standalone -d "$DOMAINS" --email "$EMAIL" -n --agree-tos --expand
/usr/sbin/nginx -g "daemon off;"

View File

@ -0,0 +1,3 @@
#!/usr/bin/env sh
python3 -c 'import random; import time; time.sleep(random.random() * 3600)' && certbot renew --webroot --webroot-path /var/lib/certbot/ --post-hook "/usr/sbin/nginx -s reload"