2016-08-22 02:11:35 +00:00
|
|
|
# NAME leenooks/nginx
|
|
|
|
# VERSION latest
|
|
|
|
|
2018-01-29 11:02:41 +00:00
|
|
|
FROM nginx:latest
|
|
|
|
COPY etc/nginx/default.d /etc/nginx/default.d
|
|
|
|
COPY var/www/maintenance /var/www/maintenance
|
2018-07-09 06:44:28 +00:00
|
|
|
RUN chmod 444 /etc/nginx/default.d/ssl/* && chmod 400 /etc/nginx/default.d/ssl/default.key /etc/nginx/default.d/ssl/dhparams.pem
|
2016-08-22 02:11:35 +00:00
|
|
|
|
2019-05-16 03:17:16 +00:00
|
|
|
RUN apt-get update && apt-get install certbot -yy \
|
2018-01-29 11:02:41 +00:00
|
|
|
&& rm -rf /var/lib/apt/lists/* /tmp/*
|
2016-08-22 02:11:35 +00:00
|
|
|
|
2019-05-16 05:10:04 +00:00
|
|
|
# Add Cloudflare Certbot
|
2020-12-07 00:43:03 +00:00
|
|
|
RUN apt-get update && apt-get install python3-certbot-dns-cloudflare -yy \
|
2019-05-16 05:10:04 +00:00
|
|
|
&& rm -rf /var/lib/apt/lists/* /tmp/*
|
|
|
|
|
2020-12-07 00:43:03 +00:00
|
|
|
# Add acme-lego Certbot
|
2021-02-02 23:25:11 +00:00
|
|
|
RUN curl -sL https://github.com/go-acme/lego/releases/download/v4.2.0/lego_v4.2.0_linux_amd64.tar.gz | tar -C /usr/local/sbin -xzf -
|
2020-12-07 00:43:03 +00:00
|
|
|
|
2018-07-09 06:13:26 +00:00
|
|
|
#RUN cd /usr/local/sbin && \
|
|
|
|
# curl -O https://dl.eff.org/certbot-auto && \
|
|
|
|
# chmod +x certbot-auto && ./certbot-auto -n --install-only
|
|
|
|
#
|
|
|
|
#RUN ln -s /usr/local/sbin/certbot-auto /usr/local/sbin/certbot
|
2018-04-10 00:22:54 +00:00
|
|
|
|
2016-08-22 02:11:35 +00:00
|
|
|
EXPOSE 80 443
|
|
|
|
|
2020-12-07 06:01:40 +00:00
|
|
|
COPY new.sh renew.sh /usr/local/sbin/
|
|
|
|
LABEL cron.container.weekly root#/usr/local/sbin/renew.sh lego
|
2017-11-20 06:01:00 +00:00
|
|
|
|
2016-08-22 02:11:35 +00:00
|
|
|
# Expose our web root and log directories log.
|
|
|
|
#VOLUME [ "/etc/nginx/conf.d", "/etc/nginx/default.d" ]
|
|
|
|
|
|
|
|
# Starting
|
|
|
|
ENTRYPOINT [ "/usr/sbin/nginx" ]
|
|
|
|
CMD [ "-g daemon off;" ]
|