This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM nginx:alpine | |
EXPOSE 80 443 | |
VOLUME ["/etc/nginx/conf.d/", "/var/www/html", "/etc/letsencrypt"] | |
RUN apk add --no-cache certbot \ | |
&& echo "0 0,12 * * * python -c 'import random; import time; time.sleep(random.random() * 3600)' && certbot renew --post-hook \"nginx -s reload\"" > /etc/crontabs/root | |
CMD ["/bin/sh", "-c", "crond -b && certbot renew && nginx -g 'daemon off;'"] |