2016-08-22 02:11:35 +00:00
|
|
|
# NAME leenooks/nginx
|
|
|
|
# VERSION latest
|
|
|
|
|
2023-02-02 12:55:08 +00:00
|
|
|
FROM nginx:alpine
|
2022-06-01 10:47:43 +00:00
|
|
|
|
2023-02-02 12:55:08 +00:00
|
|
|
# Change to http respositories, so they we can cache the install packages
|
2024-01-24 10:33:42 +00:00
|
|
|
RUN if [ -n "${HTTP_PROXY}" ] ; then echo "Using HTTP PROXY [${HTTP_PROXY}]" && sed -i -e s'/https/http/' /etc/apk/repositories; fi
|
2016-08-22 02:11:35 +00:00
|
|
|
|
2023-03-14 06:24:23 +00:00
|
|
|
RUN apk add --no-cache nginx nginx-mod-mail bash
|
2022-06-01 10:47:43 +00:00
|
|
|
|
2023-02-02 12:55:08 +00:00
|
|
|
# Add acme-lego Certbot
|
2024-01-24 10:26:42 +00:00
|
|
|
ENV LEGOVER=v4.14.2
|
2023-06-20 05:29:44 +00:00
|
|
|
RUN curl -sL https://github.com/go-acme/lego/releases/download/${LEGOVER}/lego_${LEGOVER}_linux_amd64.tar.gz | tar -C /usr/sbin -xzf -
|
2019-05-16 05:10:04 +00:00
|
|
|
|
2023-02-02 12:55:08 +00:00
|
|
|
# Configuration
|
2022-06-01 10:47:43 +00:00
|
|
|
COPY etc/nginx/nginx.conf /etc/nginx
|
|
|
|
COPY etc/nginx/default.d /etc/nginx/default.d
|
|
|
|
COPY etc/nginx/include.d /etc/nginx/include.d
|
2024-01-24 10:26:42 +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
|
2020-12-07 00:43:03 +00:00
|
|
|
|
2023-02-02 12:55:08 +00:00
|
|
|
# Default SSL cert
|
2024-01-24 10:26:42 +00:00
|
|
|
RUN mkdir -p /etc/nginx/conf.d/ssl && \
|
|
|
|
ln -s ../../default.d/ssl/default.crt /etc/nginx/conf.d/ssl/mail.crt && \
|
|
|
|
ln -s ../../default.d/ssl/default.key /etc/nginx/conf.d/ssl/mail.key
|
2023-02-02 12:55:08 +00:00
|
|
|
COPY ssl.sh /usr/sbin/
|
2023-06-20 05:29:44 +00:00
|
|
|
COPY init-docker /sbin/
|
2016-08-22 02:11:35 +00:00
|
|
|
|
2023-02-02 12:55:08 +00:00
|
|
|
COPY var/www/maintenance /var/www/maintenance
|
2017-11-20 06:01:00 +00:00
|
|
|
|
2016-08-22 02:11:35 +00:00
|
|
|
# Expose our web root and log directories log.
|
2022-06-01 10:47:43 +00:00
|
|
|
#VOLUME [ "/etc/nginx/conf.d", "/etc/nginx/default.d", "/etc/nginx/include.d" ]
|
2016-08-22 02:11:35 +00:00
|
|
|
|
|
|
|
# Starting
|
2023-02-02 12:55:08 +00:00
|
|
|
EXPOSE 80 443 25 110 143
|
2023-06-20 05:29:44 +00:00
|
|
|
LABEL cron.container.weekly root#/usr/sbin/ssl.sh lego renew
|
|
|
|
ENTRYPOINT [ "/sbin/init-docker" ]
|