2023-01-20 23:42:13 -05:00
|
|
|
# syntax=docker/dockerfile:1
|
|
|
|
|
2023-05-25 23:12:06 -04:00
|
|
|
FROM ghcr.io/linuxserver/baseimage-alpine-nginx:3.18
|
2020-08-03 11:00:14 -04:00
|
|
|
|
|
|
|
# set version label
|
|
|
|
ARG BUILD_DATE
|
|
|
|
ARG VERSION
|
|
|
|
ARG CERTBOT_VERSION
|
|
|
|
LABEL build_version="Linuxserver.io version:- ${VERSION} Build-date:- ${BUILD_DATE}"
|
2022-10-03 14:24:24 -04:00
|
|
|
LABEL maintainer="nemchik"
|
2020-08-03 11:00:14 -04:00
|
|
|
|
|
|
|
# environment settings
|
|
|
|
ENV DHLEVEL=2048 ONLY_SUBDOMAINS=false AWS_CONFIG_FILE=/config/dns-conf/route53.ini
|
2021-02-10 09:52:09 -05:00
|
|
|
ENV S6_BEHAVIOUR_IF_STAGE2_FAILS=2
|
2020-08-03 11:00:14 -04:00
|
|
|
|
|
|
|
RUN \
|
2021-04-27 11:08:22 -04:00
|
|
|
echo "**** install build packages ****" && \
|
|
|
|
apk add --no-cache --virtual=build-dependencies \
|
2023-01-20 23:42:13 -05:00
|
|
|
build-base \
|
2021-04-27 11:08:22 -04:00
|
|
|
cargo \
|
|
|
|
libffi-dev \
|
2021-10-06 15:08:00 -04:00
|
|
|
libxml2-dev \
|
|
|
|
libxslt-dev \
|
2021-04-27 11:08:22 -04:00
|
|
|
openssl-dev \
|
|
|
|
python3-dev && \
|
|
|
|
echo "**** install runtime packages ****" && \
|
2023-05-25 23:12:06 -04:00
|
|
|
apk add --no-cache \
|
2021-04-27 11:08:22 -04:00
|
|
|
fail2ban \
|
|
|
|
gnupg \
|
|
|
|
memcached \
|
|
|
|
nginx-mod-http-brotli \
|
|
|
|
nginx-mod-http-dav-ext \
|
|
|
|
nginx-mod-http-echo \
|
|
|
|
nginx-mod-http-fancyindex \
|
|
|
|
nginx-mod-http-geoip2 \
|
|
|
|
nginx-mod-http-headers-more \
|
|
|
|
nginx-mod-http-image-filter \
|
|
|
|
nginx-mod-http-perl \
|
|
|
|
nginx-mod-http-redis2 \
|
|
|
|
nginx-mod-http-set-misc \
|
|
|
|
nginx-mod-http-upload-progress \
|
|
|
|
nginx-mod-http-xslt-filter \
|
|
|
|
nginx-mod-mail \
|
|
|
|
nginx-mod-rtmp \
|
|
|
|
nginx-mod-stream \
|
|
|
|
nginx-mod-stream-geoip2 \
|
|
|
|
nginx-vim \
|
2023-05-25 23:12:06 -04:00
|
|
|
php82-bcmath \
|
|
|
|
php82-bz2 \
|
|
|
|
php82-dom \
|
|
|
|
php82-exif \
|
|
|
|
php82-ftp \
|
|
|
|
php82-gd \
|
|
|
|
php82-gmp \
|
|
|
|
php82-imap \
|
|
|
|
php82-intl \
|
|
|
|
php82-ldap \
|
|
|
|
php82-mysqli \
|
|
|
|
php82-mysqlnd \
|
|
|
|
php82-opcache \
|
|
|
|
php82-pdo_mysql \
|
|
|
|
php82-pdo_odbc \
|
|
|
|
php82-pdo_pgsql \
|
|
|
|
php82-pdo_sqlite \
|
|
|
|
php82-pear \
|
|
|
|
php82-pecl-apcu \
|
|
|
|
php82-pecl-mailparse \
|
|
|
|
php82-pecl-memcached \
|
|
|
|
php82-pecl-redis \
|
|
|
|
php82-pgsql \
|
|
|
|
php82-posix \
|
|
|
|
php82-soap \
|
|
|
|
php82-sockets \
|
|
|
|
php82-sodium \
|
|
|
|
php82-sqlite3 \
|
|
|
|
php82-tokenizer \
|
|
|
|
php82-xmlreader \
|
|
|
|
php82-xsl \
|
2021-04-27 11:08:22 -04:00
|
|
|
whois && \
|
2023-01-20 23:53:22 -05:00
|
|
|
apk add --no-cache --repository=http://dl-cdn.alpinelinux.org/alpine/edge/testing \
|
2023-05-25 23:12:06 -04:00
|
|
|
php82-pecl-mcrypt && \
|
2021-04-27 11:08:22 -04:00
|
|
|
echo "**** install certbot plugins ****" && \
|
|
|
|
if [ -z ${CERTBOT_VERSION+x} ]; then \
|
2023-01-20 23:42:13 -05:00
|
|
|
CERTBOT_VERSION=$(curl -sL https://pypi.python.org/pypi/certbot/json |jq -r '. | .info.version'); \
|
2021-04-27 11:08:22 -04:00
|
|
|
fi && \
|
2023-05-25 23:12:06 -04:00
|
|
|
python3 -m venv /lsiopy && \
|
|
|
|
pip install -U --no-cache-dir \
|
2023-01-20 23:42:13 -05:00
|
|
|
pip \
|
|
|
|
wheel && \
|
2023-05-25 23:12:06 -04:00
|
|
|
pip install -U --no-cache-dir --find-links https://wheel-index.linuxserver.io/alpine-3.18/ \
|
2023-01-20 23:42:13 -05:00
|
|
|
certbot==${CERTBOT_VERSION} \
|
2022-07-15 00:01:56 -04:00
|
|
|
certbot-dns-acmedns \
|
2021-04-27 11:08:22 -04:00
|
|
|
certbot-dns-aliyun \
|
2022-02-25 04:53:59 -05:00
|
|
|
certbot-dns-azure \
|
2021-04-27 11:08:22 -04:00
|
|
|
certbot-dns-cloudflare \
|
|
|
|
certbot-dns-cpanel \
|
2021-11-12 08:26:57 -05:00
|
|
|
certbot-dns-desec \
|
2021-04-27 11:08:22 -04:00
|
|
|
certbot-dns-digitalocean \
|
|
|
|
certbot-dns-directadmin \
|
|
|
|
certbot-dns-dnsimple \
|
|
|
|
certbot-dns-dnsmadeeasy \
|
2021-11-12 03:58:47 -05:00
|
|
|
certbot-dns-dnspod \
|
2022-09-22 17:55:32 -04:00
|
|
|
certbot-dns-do \
|
2021-04-27 11:08:22 -04:00
|
|
|
certbot-dns-domeneshop \
|
2022-10-06 14:08:20 -04:00
|
|
|
certbot-dns-duckdns \
|
2022-08-10 05:27:53 -04:00
|
|
|
certbot-dns-dynu \
|
2022-10-04 18:51:32 -04:00
|
|
|
certbot-dns-gehirn \
|
|
|
|
certbot-dns-godaddy \
|
2021-04-27 11:08:22 -04:00
|
|
|
certbot-dns-google \
|
2023-03-09 15:41:56 -05:00
|
|
|
certbot-dns-google-domains \
|
2021-10-05 19:23:25 -04:00
|
|
|
certbot-dns-he \
|
2021-04-27 11:08:22 -04:00
|
|
|
certbot-dns-hetzner \
|
2021-11-22 01:39:20 -05:00
|
|
|
certbot-dns-infomaniak \
|
2021-04-27 11:08:22 -04:00
|
|
|
certbot-dns-inwx \
|
2021-08-01 12:51:47 -04:00
|
|
|
certbot-dns-ionos \
|
2021-04-27 11:08:22 -04:00
|
|
|
certbot-dns-linode \
|
2022-04-09 12:14:35 -04:00
|
|
|
certbot-dns-loopia \
|
2021-04-27 11:08:22 -04:00
|
|
|
certbot-dns-luadns \
|
|
|
|
certbot-dns-netcup \
|
|
|
|
certbot-dns-njalla \
|
|
|
|
certbot-dns-nsone \
|
|
|
|
certbot-dns-ovh \
|
2023-02-06 19:26:07 -05:00
|
|
|
certbot-dns-porkbun \
|
2021-04-27 11:08:22 -04:00
|
|
|
certbot-dns-rfc2136 \
|
|
|
|
certbot-dns-route53 \
|
2022-10-04 18:51:32 -04:00
|
|
|
certbot-dns-sakuracloud \
|
2021-11-06 11:07:51 -04:00
|
|
|
certbot-dns-standalone \
|
2021-04-27 11:08:22 -04:00
|
|
|
certbot-dns-transip \
|
|
|
|
certbot-dns-vultr \
|
|
|
|
certbot-plugin-gandi \
|
|
|
|
cryptography \
|
2023-01-20 23:42:13 -05:00
|
|
|
future \
|
2021-04-27 11:08:22 -04:00
|
|
|
requests && \
|
2021-10-14 15:01:48 -04:00
|
|
|
echo "**** enable OCSP stapling from base ****" && \
|
|
|
|
sed -i \
|
|
|
|
's|#ssl_stapling on;|ssl_stapling on;|' \
|
|
|
|
/defaults/nginx/ssl.conf.sample && \
|
|
|
|
sed -i \
|
|
|
|
's|#ssl_stapling_verify on;|ssl_stapling_verify on;|' \
|
|
|
|
/defaults/nginx/ssl.conf.sample && \
|
|
|
|
sed -i \
|
|
|
|
's|#ssl_trusted_certificate /config/keys/cert.crt;|ssl_trusted_certificate /config/keys/cert.crt;|' \
|
|
|
|
/defaults/nginx/ssl.conf.sample && \
|
2021-12-21 14:40:37 -05:00
|
|
|
echo "**** correct ip6tables legacy issue ****" && \
|
2023-03-09 15:41:56 -05:00
|
|
|
rm \
|
2021-12-21 14:40:37 -05:00
|
|
|
/sbin/ip6tables && \
|
|
|
|
ln -s \
|
|
|
|
/sbin/ip6tables-nft /sbin/ip6tables && \
|
2021-04-27 11:08:22 -04:00
|
|
|
echo "**** remove unnecessary fail2ban filters ****" && \
|
|
|
|
rm \
|
|
|
|
/etc/fail2ban/jail.d/alpine-ssh.conf && \
|
2021-10-14 15:01:48 -04:00
|
|
|
echo "**** copy fail2ban default action and filter to /defaults ****" && \
|
2021-04-27 11:08:22 -04:00
|
|
|
mkdir -p /defaults/fail2ban && \
|
|
|
|
mv /etc/fail2ban/action.d /defaults/fail2ban/ && \
|
|
|
|
mv /etc/fail2ban/filter.d /defaults/fail2ban/ && \
|
2023-03-29 08:57:41 -04:00
|
|
|
echo "**** define allowipv6 to silence warning ****" && \
|
2023-03-29 09:26:30 -04:00
|
|
|
sed -i 's/#allowipv6 = auto/allowipv6 = auto/g' /etc/fail2ban/fail2ban.conf && \
|
2021-10-14 15:01:48 -04:00
|
|
|
echo "**** copy proxy confs to /defaults ****" && \
|
|
|
|
mkdir -p \
|
|
|
|
/defaults/nginx/proxy-confs && \
|
2021-04-27 11:08:22 -04:00
|
|
|
curl -o \
|
2021-10-14 15:01:48 -04:00
|
|
|
/tmp/proxy-confs.tar.gz -L \
|
2021-04-27 11:08:22 -04:00
|
|
|
"https://github.com/linuxserver/reverse-proxy-confs/tarball/master" && \
|
|
|
|
tar xf \
|
2021-10-14 15:01:48 -04:00
|
|
|
/tmp/proxy-confs.tar.gz -C \
|
|
|
|
/defaults/nginx/proxy-confs --strip-components=1 --exclude=linux*/.editorconfig --exclude=linux*/.gitattributes --exclude=linux*/.github --exclude=linux*/.gitignore --exclude=linux*/LICENSE && \
|
2021-04-27 11:08:22 -04:00
|
|
|
echo "**** cleanup ****" && \
|
|
|
|
apk del --purge \
|
|
|
|
build-dependencies && \
|
|
|
|
rm -rf \
|
|
|
|
/tmp/* \
|
2023-01-20 23:42:13 -05:00
|
|
|
$HOME/.cache \
|
|
|
|
$HOME/.cargo
|
2020-08-03 11:00:14 -04:00
|
|
|
|
2022-08-21 18:05:56 -04:00
|
|
|
# copy local files
|
2020-08-03 11:00:14 -04:00
|
|
|
COPY root/ /
|
2022-08-21 18:05:56 -04:00
|
|
|
|
|
|
|
# ports and volumes
|
|
|
|
EXPOSE 80 443
|
|
|
|
VOLUME /config
|