Re-structured nginx config

This commit is contained in:
Jef Roosens 2021-01-05 14:28:58 +01:00
parent da1df2e798
commit e39e11b3fe
10 changed files with 11 additions and 2 deletions

14
nginx/build/Dockerfile Normal 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,4 @@
#!/usr/bin/env sh
certbot certonly --standalone -d "$DOMAINS" --email "$EMAIL" -n --agree-tos --expand
/usr/sbin/nginx -g "daemon off;"

3
nginx/build/renew Normal file
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"