nginx/Dockerfile
2019-05-16 15:10:04 +10:00

34 lines
1.1 KiB
Docker

# NAME leenooks/nginx
# VERSION latest
FROM nginx:latest
COPY etc/nginx/default.d /etc/nginx/default.d
COPY var/www/maintenance /var/www/maintenance
RUN chmod 444 /etc/nginx/default.d/ssl/* && chmod 400 /etc/nginx/default.d/ssl/default.key /etc/nginx/default.d/ssl/dhparams.pem
RUN apt-get update && apt-get install certbot -yy \
&& rm -rf /var/lib/apt/lists/* /tmp/*
# Add Cloudflare Certbot
RUN echo "deb http://ftp.debian.org/debian stretch-backports main" > /etc/apt/sources.list.d/stretch-backports.list \
&& apt-get update && apt-get -t stretch-backports install python3-certbot-dns-cloudflare -yy \
&& rm -rf /var/lib/apt/lists/* /tmp/*
#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
EXPOSE 80 443
COPY renew.sh /usr/local/sbin
LABEL cron.container.weekly root:/usr/local/sbin/renew.sh
# 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;" ]