docker-swag/Dockerfile

184 lines
5.0 KiB
Docker
Raw Normal View History

2023-01-21 04:42:13 +00:00
# syntax=docker/dockerfile:1
FROM ghcr.io/linuxserver/baseimage-alpine-nginx:3.17
2020-08-03 15:00:14 +00: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 18:24:24 +00:00
LABEL maintainer="nemchik"
2020-08-03 15:00:14 +00:00
# environment settings
ENV DHLEVEL=2048 ONLY_SUBDOMAINS=false AWS_CONFIG_FILE=/config/dns-conf/route53.ini
2021-02-10 14:52:09 +00:00
ENV S6_BEHAVIOUR_IF_STAGE2_FAILS=2
2020-08-03 15:00:14 +00:00
RUN \
2021-04-27 15:08:22 +00:00
echo "**** install build packages ****" && \
apk add --no-cache --virtual=build-dependencies \
2023-01-21 04:42:13 +00:00
build-base \
2021-04-27 15:08:22 +00:00
cargo \
libffi-dev \
2021-10-06 19:08:00 +00:00
libxml2-dev \
libxslt-dev \
2021-04-27 15:08:22 +00:00
openssl-dev \
python3-dev && \
echo "**** install runtime packages ****" && \
apk add --no-cache --upgrade \
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-01-21 04:42:13 +00:00
php81-bcmath \
php81-bz2 \
php81-ctype \
php81-curl \
php81-dom \
php81-exif \
php81-ftp \
php81-gd \
php81-gmp \
php81-iconv \
php81-imap \
php81-intl \
php81-ldap \
php81-mysqli \
php81-mysqlnd \
php81-opcache \
php81-pdo_mysql \
php81-pdo_odbc \
php81-pdo_pgsql \
php81-pdo_sqlite \
php81-pear \
php81-pecl-apcu \
php81-pecl-mailparse \
php81-pecl-memcached \
php81-pecl-redis \
php81-pgsql \
php81-phar \
php81-posix \
php81-soap \
php81-sockets \
php81-sodium \
php81-sqlite3 \
php81-tokenizer \
php81-xmlreader \
php81-xsl \
php81-zip \
2021-04-27 15:08:22 +00:00
whois && \
2023-01-21 04:53:22 +00:00
apk add --no-cache --repository=http://dl-cdn.alpinelinux.org/alpine/edge/testing \
php81-pecl-mcrypt \
2023-01-21 04:42:13 +00:00
php81-pecl-xmlrpc && \
2021-04-27 15:08:22 +00:00
echo "**** install certbot plugins ****" && \
if [ -z ${CERTBOT_VERSION+x} ]; then \
2023-01-21 04:42:13 +00:00
CERTBOT_VERSION=$(curl -sL https://pypi.python.org/pypi/certbot/json |jq -r '. | .info.version'); \
2021-04-27 15:08:22 +00:00
fi && \
2023-01-21 04:42:13 +00:00
python3 -m ensurepip && \
pip3 install -U --no-cache-dir \
pip \
wheel && \
pip3 install -U --no-cache-dir --find-links https://wheel-index.linuxserver.io/alpine-3.17/ \
certbot==${CERTBOT_VERSION} \
certbot-dns-acmedns \
2021-04-27 15:08:22 +00:00
certbot-dns-aliyun \
2022-02-25 09:53:59 +00:00
certbot-dns-azure \
2021-04-27 15:08:22 +00:00
certbot-dns-cloudflare \
certbot-dns-cpanel \
2021-11-12 13:26:57 +00:00
certbot-dns-desec \
2021-04-27 15:08:22 +00:00
certbot-dns-digitalocean \
certbot-dns-directadmin \
certbot-dns-dnsimple \
certbot-dns-dnsmadeeasy \
certbot-dns-dnspod \
certbot-dns-do \
2021-04-27 15:08:22 +00:00
certbot-dns-domeneshop \
2022-10-06 18:08:20 +00:00
certbot-dns-duckdns \
2022-08-10 09:27:53 +00:00
certbot-dns-dynu \
certbot-dns-gehirn \
certbot-dns-godaddy \
2021-04-27 15:08:22 +00:00
certbot-dns-google \
certbot-dns-he \
2021-04-27 15:08:22 +00:00
certbot-dns-hetzner \
2021-11-22 06:39:20 +00:00
certbot-dns-infomaniak \
2021-04-27 15:08:22 +00:00
certbot-dns-inwx \
2021-08-01 16:51:47 +00:00
certbot-dns-ionos \
2021-04-27 15:08:22 +00:00
certbot-dns-linode \
2022-04-09 16:14:35 +00:00
certbot-dns-loopia \
2021-04-27 15:08:22 +00:00
certbot-dns-luadns \
certbot-dns-netcup \
certbot-dns-njalla \
certbot-dns-nsone \
certbot-dns-ovh \
2023-02-07 00:26:07 +00:00
certbot-dns-porkbun \
2021-04-27 15:08:22 +00:00
certbot-dns-rfc2136 \
certbot-dns-route53 \
certbot-dns-sakuracloud \
certbot-dns-standalone \
2021-04-27 15:08:22 +00:00
certbot-dns-transip \
certbot-dns-vultr \
certbot-plugin-gandi \
cryptography \
2023-01-21 04:42:13 +00:00
future \
2021-04-27 15:08:22 +00:00
requests && \
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 && \
echo "**** correct ip6tables legacy issue ****" && \
rm \
/sbin/ip6tables && \
ln -s \
/sbin/ip6tables-nft /sbin/ip6tables && \
2021-04-27 15:08:22 +00:00
echo "**** remove unnecessary fail2ban filters ****" && \
rm \
/etc/fail2ban/jail.d/alpine-ssh.conf && \
echo "**** copy fail2ban default action and filter to /defaults ****" && \
2021-04-27 15:08:22 +00:00
mkdir -p /defaults/fail2ban && \
mv /etc/fail2ban/action.d /defaults/fail2ban/ && \
mv /etc/fail2ban/filter.d /defaults/fail2ban/ && \
echo "**** copy proxy confs to /defaults ****" && \
mkdir -p \
/defaults/nginx/proxy-confs && \
2021-04-27 15:08:22 +00:00
curl -o \
/tmp/proxy-confs.tar.gz -L \
2021-04-27 15:08:22 +00:00
"https://github.com/linuxserver/reverse-proxy-confs/tarball/master" && \
tar xf \
/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 15:08:22 +00:00
echo "**** cleanup ****" && \
apk del --purge \
build-dependencies && \
rm -rf \
/tmp/* \
2023-01-21 04:42:13 +00:00
$HOME/.cache \
$HOME/.cargo
2020-08-03 15:00:14 +00:00
2022-08-21 22:05:56 +00:00
# copy local files
2020-08-03 15:00:14 +00:00
COPY root/ /
2022-08-21 22:05:56 +00:00
# ports and volumes
EXPOSE 80 443
VOLUME /config