|
| 1 | +FROM lsiobase/nginx:3.12 |
| 2 | + |
| 3 | +# set version label |
| 4 | +ARG BUILD_DATE |
| 5 | +ARG VERSION |
| 6 | +ARG CERTBOT_VERSION |
| 7 | +LABEL build_version="Linuxserver.io version:- ${VERSION} Build-date:- ${BUILD_DATE}" |
| 8 | +LABEL maintainer="aptalca" |
| 9 | + |
| 10 | +# environment settings |
| 11 | +ENV DHLEVEL=2048 ONLY_SUBDOMAINS=false AWS_CONFIG_FILE=/config/dns-conf/route53.ini |
| 12 | +ENV S6_BEHAVIOUR_IF_STAGE2_FAILS=2 |
| 13 | + |
| 14 | +RUN \ |
| 15 | + echo "**** install build packages ****" && \ |
| 16 | + apk add --no-cache --virtual=build-dependencies \ |
| 17 | + g++ \ |
| 18 | + gcc \ |
| 19 | + libffi-dev \ |
| 20 | + openssl-dev \ |
| 21 | + python3-dev && \ |
| 22 | + echo "**** install runtime packages ****" && \ |
| 23 | + apk add --no-cache --upgrade \ |
| 24 | + curl \ |
| 25 | + fail2ban \ |
| 26 | + gnupg \ |
| 27 | + memcached \ |
| 28 | + nginx \ |
| 29 | + nginx-mod-http-echo \ |
| 30 | + nginx-mod-http-fancyindex \ |
| 31 | + nginx-mod-http-geoip2 \ |
| 32 | + nginx-mod-http-headers-more \ |
| 33 | + nginx-mod-http-image-filter \ |
| 34 | + nginx-mod-http-lua \ |
| 35 | + nginx-mod-http-lua-upstream \ |
| 36 | + nginx-mod-http-nchan \ |
| 37 | + nginx-mod-http-perl \ |
| 38 | + nginx-mod-http-redis2 \ |
| 39 | + nginx-mod-http-set-misc \ |
| 40 | + nginx-mod-http-upload-progress \ |
| 41 | + nginx-mod-http-xslt-filter \ |
| 42 | + nginx-mod-mail \ |
| 43 | + nginx-mod-rtmp \ |
| 44 | + nginx-mod-stream \ |
| 45 | + nginx-mod-stream-geoip2 \ |
| 46 | + nginx-vim \ |
| 47 | + php7-bcmath \ |
| 48 | + php7-bz2 \ |
| 49 | + php7-ctype \ |
| 50 | + php7-curl \ |
| 51 | + php7-dom \ |
| 52 | + php7-exif \ |
| 53 | + php7-ftp \ |
| 54 | + php7-gd \ |
| 55 | + php7-iconv \ |
| 56 | + php7-imap \ |
| 57 | + php7-intl \ |
| 58 | + php7-ldap \ |
| 59 | + php7-mcrypt \ |
| 60 | + php7-memcached \ |
| 61 | + php7-mysqli \ |
| 62 | + php7-mysqlnd \ |
| 63 | + php7-opcache \ |
| 64 | + php7-pdo_mysql \ |
| 65 | + php7-pdo_odbc \ |
| 66 | + php7-pdo_pgsql \ |
| 67 | + php7-pdo_sqlite \ |
| 68 | + php7-pear \ |
| 69 | + php7-pecl-apcu \ |
| 70 | + php7-pecl-redis \ |
| 71 | + php7-pgsql \ |
| 72 | + php7-phar \ |
| 73 | + php7-posix \ |
| 74 | + php7-soap \ |
| 75 | + php7-sockets \ |
| 76 | + php7-sodium \ |
| 77 | + php7-sqlite3 \ |
| 78 | + php7-tokenizer \ |
| 79 | + php7-xml \ |
| 80 | + php7-xmlreader \ |
| 81 | + php7-xmlrpc \ |
| 82 | + php7-zip \ |
| 83 | + py3-cryptography \ |
| 84 | + py3-future \ |
| 85 | + py3-pip \ |
| 86 | + whois && \ |
| 87 | + echo "**** install certbot plugins ****" && \ |
| 88 | + if [ -z ${CERTBOT_VERSION+x} ]; then \ |
| 89 | + CERTBOT="certbot"; \ |
| 90 | + else \ |
| 91 | + CERTBOT="certbot==${CERTBOT_VERSION}"; \ |
| 92 | + fi && \ |
| 93 | + pip3 install -U \ |
| 94 | + pip && \ |
| 95 | + pip3 install -U \ |
| 96 | + ${CERTBOT} \ |
| 97 | + certbot-dns-aliyun \ |
| 98 | + certbot-dns-cloudflare \ |
| 99 | + certbot-dns-cloudxns \ |
| 100 | + certbot-dns-cpanel \ |
| 101 | + certbot-dns-digitalocean \ |
| 102 | + certbot-dns-dnsimple \ |
| 103 | + certbot-dns-dnsmadeeasy \ |
| 104 | + certbot-dns-domeneshop \ |
| 105 | + certbot-dns-google \ |
| 106 | + certbot-dns-inwx \ |
| 107 | + certbot-dns-linode \ |
| 108 | + certbot-dns-luadns \ |
| 109 | + certbot-dns-nsone \ |
| 110 | + certbot-dns-ovh \ |
| 111 | + certbot-dns-rfc2136 \ |
| 112 | + certbot-dns-route53 \ |
| 113 | + certbot-dns-transip \ |
| 114 | + certbot-plugin-gandi \ |
| 115 | + cryptography \ |
| 116 | + requests && \ |
| 117 | + echo "**** remove unnecessary fail2ban filters ****" && \ |
| 118 | + rm \ |
| 119 | + /etc/fail2ban/jail.d/alpine-ssh.conf && \ |
| 120 | + echo "**** copy fail2ban default action and filter to /default ****" && \ |
| 121 | + mkdir -p /defaults/fail2ban && \ |
| 122 | + mv /etc/fail2ban/action.d /defaults/fail2ban/ && \ |
| 123 | + mv /etc/fail2ban/filter.d /defaults/fail2ban/ && \ |
| 124 | + echo "**** copy proxy confs to /default ****" && \ |
| 125 | + mkdir -p /defaults/proxy-confs && \ |
| 126 | + curl -o \ |
| 127 | + /tmp/proxy.tar.gz -L \ |
| 128 | + "https://github.com/linuxserver/reverse-proxy-confs/tarball/master" && \ |
| 129 | + tar xf \ |
| 130 | + /tmp/proxy.tar.gz -C \ |
| 131 | + /defaults/proxy-confs --strip-components=1 --exclude=linux*/.gitattributes --exclude=linux*/.github --exclude=linux*/.gitignore --exclude=linux*/LICENSE && \ |
| 132 | + echo "**** configure nginx ****" && \ |
| 133 | + rm -f /etc/nginx/conf.d/default.conf && \ |
| 134 | + curl -o \ |
| 135 | + /defaults/dhparams.pem -L \ |
| 136 | + "https://lsio.ams3.digitaloceanspaces.com/dhparams.pem" && \ |
| 137 | + echo "**** cleanup ****" && \ |
| 138 | + apk del --purge \ |
| 139 | + build-dependencies && \ |
| 140 | + for cleanfiles in *.pyc *.pyo; \ |
| 141 | + do \ |
| 142 | + find /usr/lib/python3.* -iname "${cleanfiles}" -exec rm -f '{}' + \ |
| 143 | + ; done && \ |
| 144 | + rm -rf \ |
| 145 | + /tmp/* \ |
| 146 | + /root/.cache |
| 147 | + |
| 148 | +# add local files |
| 149 | +COPY root/ / |
0 commit comments