From 407722421784914c947c2771743e01cdb3bcf829 Mon Sep 17 00:00:00 2001 From: Mr Bot Date: Tue, 24 Sep 2019 16:22:11 +0300 Subject: [PATCH] cleanup --- balancer/experemental/Dockerfile | 197 ---------------- balancer/experemental/Makefile | 4 - balancer/experemental/script.txt | 141 ------------ balancer/latest/Dockerfile | 216 +++++++++++++++--- balancer/latest/Makefile | 2 +- .../pre/luajit2-description-pak | 0 .../pre/nginx-description-pak | 0 .../pre/ngninx.pre.tar.gz | Bin .../.docker-repository.yml | 0 .../{experemental => legacy}/.dockerignore | 0 balancer/legacy/Dockerfile | 41 ++++ balancer/legacy/Makefile | 4 + balancer/{experemental => legacy}/README.md | 0 balancer/{latest => legacy}/locale.gen | 0 balancer/{latest => legacy}/sources.list | 0 balancer/php/.docker-repository.yml | 1 + balancer/php/.dockerignore | 3 + balancer/php/Dockerfile | 136 +++++++++++ balancer/php/Makefile | 4 + balancer/php/README.md | 30 +++ 20 files changed, 408 insertions(+), 371 deletions(-) delete mode 100644 balancer/experemental/Dockerfile delete mode 100644 balancer/experemental/Makefile delete mode 100644 balancer/experemental/script.txt rename balancer/{experemental => latest}/pre/luajit2-description-pak (100%) rename balancer/{experemental => latest}/pre/nginx-description-pak (100%) rename balancer/{experemental => latest}/pre/ngninx.pre.tar.gz (100%) rename balancer/{experemental => legacy}/.docker-repository.yml (100%) rename balancer/{experemental => legacy}/.dockerignore (100%) create mode 100644 balancer/legacy/Dockerfile create mode 100644 balancer/legacy/Makefile rename balancer/{experemental => legacy}/README.md (100%) rename balancer/{latest => legacy}/locale.gen (100%) rename balancer/{latest => legacy}/sources.list (100%) create mode 100644 balancer/php/.docker-repository.yml create mode 100644 balancer/php/.dockerignore create mode 100644 balancer/php/Dockerfile create mode 100644 balancer/php/Makefile create mode 100644 balancer/php/README.md diff --git a/balancer/experemental/Dockerfile b/balancer/experemental/Dockerfile deleted file mode 100644 index 526a558be..000000000 --- a/balancer/experemental/Dockerfile +++ /dev/null @@ -1,197 +0,0 @@ -FROM epicmorg/devel AS builder -LABEL maintainer="EpicMorg DevTeam, developer@epicm.org" -ARG DEBIAN_FRONTEND=noninteractive - -################################################################## -# ARGuments -################################################################## -ENV BuildDocker true -ARG BUILDS_DIR=/builds -ARG SRC_DIR=${BUILDS_DIR}/src -ARG EXPORT_DIR=${BUILDS_DIR}/export -ARG PRE_DIR=${BUILDS_DIR}/pre -ARG NGINX_SRC_DIR=${SRC_DIR}/nginx -ARG NGINX_VERSION=1.17.3 -ARG NGINX_DOWNLOAD_URL=http://nginx.org/download/nginx-${NGINX_VERSION}.tar.gz -ARG LUAJIT_INC=/usr/local/include/luajit-2.1 -ARG LUAJIT_LIB=/usr/local/lib - -################################################################## -# Files and folders -################################################################## -RUN mkdir -p ${PRE_DIR} ${NGINX_SRC_DIR} /usr/lib/nginx -ADD pre/luajit2-description-pak ${PRE_DIR} -ADD pre/nginx-description-pak ${PRE_DIR} - -################################################################## -# luaJIT 2 support for prod nginx module -################################################################## -RUN cd ${SRC_DIR} && \ - git clone https://github.com/openresty/luajit2.git luajit2 && \ - cp -fv ${PRE_DIR}/luajit2-description-pak ${SRC_DIR}/luajit2/description-pak && \ - cd ${SRC_DIR}/luajit2 && \ - make && \ - make install && \ - fakeroot checkinstall -D --pakdir=${EXPORT_DIR} --maintainer="EpicMorg, developer@epicm.org" --pkgname=luajit2-custom --conflicts=luajit2 --install=no -y - -################################################################## -# nginx preparing -################################################################## -RUN wget -qO - ${NGINX_DOWNLOAD_URL} | tar -zxv --strip-components=1 -C ${NGINX_SRC_DIR} && \ - cd ${NGINX_SRC_DIR} && \ - git clone https://github.com/openresty/headers-more-nginx-module.git http-headers-more-filter && \ - git clone https://github.com/sto/ngx_http_auth_pam_module.git http-auth-pam && \ - git clone https://github.com/arut/nginx-dav-ext-module.git http-dav-ext && \ - git clone https://github.com/openresty/echo-nginx-module.git http-echo && \ - git clone https://github.com/aperezdc/ngx-fancyindex.git http-fancyindex && \ - git clone https://github.com/slact/nchan.git nchan && \ - git clone https://github.com/masterzen/nginx-upload-progress-module.git http-uploadprogress && \ - git clone https://github.com/yaoweibin/ngx_http_substitutions_filter_module http-subs-filter && \ - git clone https://github.com/grahamedgecombe/nginx-ct.git ssl-ct && \ - git clone https://github.com/stnoonan/spnego-http-auth-nginx-module.git spnego-http-auth-nginx-module && \ - git clone https://github.com/leev/ngx_http_geoip2_module http-geoip2 && \ - git clone https://github.com/flavioribeiro/nginx-audio-track-for-hls-module.git nginx-audio-track-for-hls-module && \ - git clone https://github.com/chrislim2888/ip2location-nginx.git ip2location-nginx && \ - git clone https://github.com/kaltura/nginx-vod-module.git nginx-vod-module && \ - git clone https://github.com/vozlt/nginx-module-vts.git nginx-module-vts && \ - git clone https://github.com/evanmiller/mod_zip.git mod-zip && \ - git clone https://github.com/alibaba/nginx-http-user-agent.git nginx-http-user-agent && \ - git clone https://github.com/youzee/nginx-unzip-module.git nginx-unzip-module && \ - git clone https://github.com/vladbondarenko/ngx_webp.git ngx-webp && \ - git clone https://github.com/openresty/xss-nginx-module.git xss-nginx-module && \ - git clone https://github.com/openresty/set-misc-nginx-module.git set-misc-nginx-module && \ - git clone https://github.com/arut/nginx-rtmp-module.git rtmp && \ - git clone https://github.com/kvspb/nginx-auth-ldap.git http-auth-ldap && \ - git clone https://github.com/simplresty/ngx_devel_kit.git http-ndk && \ - git clone https://github.com/chrislim2888/IP2Location-C-Library.git ip2location-c-7.0.0 && \ - git clone https://github.com/itoffshore/nginx-upstream-fair.git http-upstream-fair && \ - git clone https://github.com/yaoweibin/nginx_upstream_check_module.git nginx-upstream-check-module && \ - git clone https://github.com/openresty/lua-nginx-module http-lua - -################################################################## -# nginx compilling -################################################################## -RUN cd ${NGINX_SRC_DIR} && \ - ./configure \ - --sbin-path=/usr/sbin/nginx \ - --prefix=/usr/share/nginx \ - --conf-path=/etc/nginx/nginx.conf \ - --http-log-path=/var/log/nginx/access.log \ - --error-log-path=/var/log/nginx/error.log \ - --lock-path=/var/lock/nginx.lock \ - --pid-path=/run/nginx.pid \ - --modules-path=/usr/lib/nginx/modules \ - --http-client-body-temp-path=/var/lib/nginx/body \ - --http-fastcgi-temp-path=/var/lib/nginx/fastcgi \ - --http-proxy-temp-path=/var/lib/nginx/proxy \ - --http-scgi-temp-path=/var/lib/nginx/scgi \ - --http-uwsgi-temp-path=/var/lib/nginx/uwsgi \ - --with-cc-opt='-I/usr/local/include/luajit-2.1 -g -O2 -lz -fstack-protector-strong -Wformat -Wno-error=date-time -Wno-error=implicit-fallthrough= -Wno-error=cast-function-type -Wno-error=format-security -Wno-error=implicit-function-declaration -Wno-error=deprecated-declarations -Wno-error=unused-result -fPIC -Wdate-time -D_FORTIFY_SOURCE=2' \ - --with-ld-opt='-Wl,-z,relro -Wl,-z,now -lz -fPIC -L/usr/local/lib' \ - --with-file-aio \ - --with-compat \ - --with-debug \ - --with-threads \ - --with-pcre-jit \ - --with-http_ssl_module \ - --with-http_stub_status_module \ - --with-http_realip_module \ - --with-http_auth_request_module \ - --with-http_v2_module \ - --with-http_dav_module \ - --with-http_slice_module \ - --with-http_addition_module \ - --with-http_flv_module \ - --with-http_geoip_module=dynamic \ - --with-http_gunzip_module \ - --with-http_gzip_static_module \ - --with-http_image_filter_module=dynamic \ - --with-http_mp4_module \ - --with-http_perl_module=dynamic \ - --with-http_random_index_module \ - --with-http_secure_link_module \ - --with-http_sub_module \ - --with-http_xslt_module=dynamic \ - --with-mail=dynamic \ - --with-mail_ssl_module \ - --with-stream=dynamic \ - --with-stream_ssl_module \ - --with-stream_ssl_preread_module \ - --add-dynamic-module=http-headers-more-filter \ - --add-dynamic-module=http-auth-pam \ - --add-dynamic-module=http-dav-ext \ - --add-dynamic-module=http-ndk \ - --add-dynamic-module=http-echo \ - --add-dynamic-module=http-fancyindex \ - --add-dynamic-module=nchan \ - --add-dynamic-module=http-uploadprogress \ - --add-dynamic-module=http-subs-filter \ - --add-dynamic-module=ssl-ct \ - --add-dynamic-module=http-geoip2 \ - --add-dynamic-module=spnego-http-auth-nginx-module \ - --add-dynamic-module=http-auth-ldap \ - --add-dynamic-module=nginx-audio-track-for-hls-module \ - --add-dynamic-module=ip2location-nginx \ - --add-dynamic-module=nginx-vod-module \ - --add-dynamic-module=nginx-module-vts \ - --add-dynamic-module=mod-zip \ - --add-dynamic-module=nginx-http-user-agent \ - --add-dynamic-module=nginx-unzip-module \ - --add-dynamic-module=ngx-webp \ - --add-dynamic-module=set-misc-nginx-module \ - --add-dynamic-module=rtmp \ - --add-dynamic-module=http-upstream-fair \ - --add-dynamic-module=nginx-upstream-check-module \ - --add-dynamic-module=http-lua && \ - cp -fv ${PRE_DIR}/nginx-description-pak ${NGINX_SRC_DIR}/description-pak && \ - fakeroot checkinstall -D --pakdir=/builds/export --maintainer="EpicMorg, developer@epicm.org" --pkgname=nginx-custom --install=no -y - -################################################################## -# cleaninig up -################################################################## -RUN apt clean -y && \ - apt autoclean -y && \ - rm -rfv /var/lib/apt/lists/* && \ - rm -rfv /var/cache/apt/archives/*.deb - -################################################################## -################################################################## -################################################################## - -FROM epicmorg/prod -LABEL maintainer="EpicMorg DevTeam, developer@epicm.org" -ARG DEBIAN_FRONTEND=noninteractive - -################################################################## -# Installing nginx from deb -################################################################## -ADD pre/ngninx.pre.tar.gz / -COPY --from=builder /builds/export /tmp/deb -RUN apt-get update && \ - apt-get install -y --allow-unauthenticated \ - geoip-database \ - geoip-bin \ - libgeoip1 \ - libmaxminddb0 \ - libgd3 \ - libxslt1.1 && \ - dpkg --force-all -i /tmp/deb/*.deb && \ - ln -s /usr/local/lib/libIP2Location.so /usr/lib/libIP2Location.so && \ - ln -s /usr/local/lib/libIP2Location.so.1 /usr/lib/libIP2Location.so.1 && \ - ln -s /usr/local/lib/libIP2Location.so /lib/libIP2Location.so && \ - ln -s /usr/local/lib/libIP2Location.so.1 /lib/libIP2Location.so.1 - -################################################################## -# cleaninig up -################################################################## -RUN apt clean -y && \ - apt autoclean -y && \ - rm -rfv /var/lib/apt/lists/* && \ - rm -rfv /var/cache/apt/archives/*.deb && \ - rm -rfv /tmp/deb/* - -#Final config -VOLUME ["/var/cache/nginx"] -EXPOSE 80 443 - -CMD ["nginx", "-g", "daemon off;"] diff --git a/balancer/experemental/Makefile b/balancer/experemental/Makefile deleted file mode 100644 index b6b5573be..000000000 --- a/balancer/experemental/Makefile +++ /dev/null @@ -1,4 +0,0 @@ -all: nginx - -nginx: - docker build --compress -t epicmorg/balancer:testing . diff --git a/balancer/experemental/script.txt b/balancer/experemental/script.txt deleted file mode 100644 index fd0abfca4..000000000 --- a/balancer/experemental/script.txt +++ /dev/null @@ -1,141 +0,0 @@ -zlibc zlib1g zlib1g-dev libssl-dev libxml2-dev libxslt-dev libgd-dev libpcre3-dev libgeoip-dev libkrb5-dev libperl-dev krb5-user samba luajit liblua5.1-0-dev libmaxminddb-dev libpam0g-dev libldap2-dev libavformat-dev libavfilter-dev libswscale-dev libavcodec-dev libz-dev libgd-dev libhiredis-dev libzip-dev libcrypto++-dev libbz2-dev tcl - -mkdir -p /builds/export /builds/src -wget -qO - http://nginx.org/download/nginx-1.17.3.tar.gz | tar zxv - - - - -[lua pre] -git clone https://github.com/openresty/luajit2.git luajit2 # - -make -make install -cat > description-pak -fakeroot checkinstall -D --pakdir=/builds/export --maintainer="EpicMorg, developer@epicm.org" --pkgname=luajit2-custom --conflicts=luajit2 --install=no -y - - - - ------------------------- - -export LUAJIT_INC=/usr/local/include/luajit-2.1 -export LUAJIT_LIB=/usr/local/lib - -[redis pre] - -[modules] -git clone https://github.com/openresty/headers-more-nginx-module.git http-headers-more-filter -git clone https://github.com/sto/ngx_http_auth_pam_module.git http-auth-pam -git clone https://github.com/arut/nginx-dav-ext-module.git http-dav-ext -git clone https://github.com/openresty/echo-nginx-module.git http-echo -git clone https://github.com/aperezdc/ngx-fancyindex.git http-fancyindex -git clone https://github.com/slact/nchan.git nchan -git clone https://github.com/masterzen/nginx-upload-progress-module.git http-uploadprogress -git clone https://github.com/yaoweibin/ngx_http_substitutions_filter_module http-subs-filter -git clone https://github.com/grahamedgecombe/nginx-ct.git ssl-ct -git clone https://github.com/stnoonan/spnego-http-auth-nginx-module.git spnego-http-auth-nginx-module -git clone https://github.com/leev/ngx_http_geoip2_module http-geoip2 -git clone https://github.com/flavioribeiro/nginx-audio-track-for-hls-module.git nginx-audio-track-for-hls-module -git clone https://github.com/chrislim2888/ip2location-nginx.git ip2location-nginx -git clone https://github.com/kaltura/nginx-vod-module.git nginx-vod-module -git clone https://github.com/vozlt/nginx-module-vts.git nginx-module-vts -git clone https://github.com/evanmiller/mod_zip.git mod-zip -git clone https://github.com/alibaba/nginx-http-user-agent.git nginx-http-user-agent -git clone https://github.com/youzee/nginx-unzip-module.git nginx-unzip-module -git clone https://github.com/vladbondarenko/ngx_webp.git ngx-webp -git clone https://github.com/openresty/xss-nginx-module.git xss-nginx-module -git clone https://github.com/openresty/set-misc-nginx-module.git set-misc-nginx-module -git clone https://github.com/arut/nginx-rtmp-module.git rtmp -git clone https://github.com/kvspb/nginx-auth-ldap.git http-auth-ldap -git clone https://github.com/simplresty/ngx_devel_kit.git http-ndk -git clone https://github.com/chrislim2888/IP2Location-C-Library.git ip2location-c-7.0.0 -git clone https://github.com/itoffshore/nginx-upstream-fair.git http-upstream-fair #fixed fork -git clone https://github.com/yaoweibin/nginx_upstream_check_module.git nginx-upstream-check-module -git clone https://github.com/openresty/lua-nginx-module http-lua - - -./configure \ ---sbin-path=/usr/sbin/nginx \ ---prefix=/usr/share/nginx \ ---conf-path=/etc/nginx/nginx.conf \ ---http-log-path=/var/log/nginx/access.log \ ---error-log-path=/var/log/nginx/error.log \ ---lock-path=/var/lock/nginx.lock \ ---pid-path=/run/nginx.pid \ ---modules-path=/usr/lib/nginx/modules \ ---http-client-body-temp-path=/var/lib/nginx/body \ ---http-fastcgi-temp-path=/var/lib/nginx/fastcgi \ ---http-proxy-temp-path=/var/lib/nginx/proxy \ ---http-scgi-temp-path=/var/lib/nginx/scgi \ ---http-uwsgi-temp-path=/var/lib/nginx/uwsgi \ ---with-cc-opt='-I/usr/local/include/luajit-2.1 -g -O2 -lz -fstack-protector-strong -Wformat -Wno-error=date-time -Wno-error=implicit-fallthrough= -Wno-error=cast-function-type -Wno-error=format-security -Wno-error=implicit-function-declaration -Wno-error=deprecated-declarations -Wno-error=unused-result -fPIC -Wdate-time -D_FORTIFY_SOURCE=2' \ ---with-ld-opt='-Wl,-z,relro -Wl,-z,now -lz -fPIC -L/usr/local/lib' \ ---with-file-aio \ ---with-compat \ ---with-debug \ ---with-threads \ ---with-pcre-jit \ ---with-http_ssl_module \ ---with-http_stub_status_module \ ---with-http_realip_module \ ---with-http_auth_request_module \ ---with-http_v2_module \ ---with-http_dav_module \ ---with-http_slice_module \ ---with-http_addition_module \ ---with-http_flv_module \ ---with-http_geoip_module=dynamic \ ---with-http_gunzip_module \ ---with-http_gzip_static_module \ ---with-http_image_filter_module=dynamic \ ---with-http_mp4_module \ ---with-http_perl_module=dynamic \ ---with-http_random_index_module \ ---with-http_secure_link_module \ ---with-http_sub_module \ ---with-http_xslt_module=dynamic \ ---with-mail=dynamic \ ---with-mail_ssl_module \ ---with-stream=dynamic \ ---with-stream_ssl_module \ ---with-stream_ssl_preread_module \ ---add-dynamic-module=http-headers-more-filter \ ---add-dynamic-module=http-auth-pam \ ---add-dynamic-module=http-dav-ext \ ---add-dynamic-module=http-ndk \ ---add-dynamic-module=http-echo \ ---add-dynamic-module=http-fancyindex \ ---add-dynamic-module=nchan \ ---add-dynamic-module=http-uploadprogress \ ---add-dynamic-module=http-subs-filter \ ---add-dynamic-module=ssl-ct \ ---add-dynamic-module=http-geoip2 \ ---add-dynamic-module=spnego-http-auth-nginx-module \ ---add-dynamic-module=http-auth-ldap \ ---add-dynamic-module=nginx-audio-track-for-hls-module \ ---add-dynamic-module=ip2location-nginx \ ---add-dynamic-module=nginx-vod-module \ ---add-dynamic-module=nginx-module-vts \ ---add-dynamic-module=mod-zip \ ---add-dynamic-module=nginx-http-user-agent \ ---add-dynamic-module=nginx-unzip-module \ ---add-dynamic-module=ngx-webp \ ---add-dynamic-module=set-misc-nginx-module \ ---add-dynamic-module=rtmp \ ---add-dynamic-module=http-upstream-fair \ ---add-dynamic-module=nginx-upstream-check-module \ ---add-dynamic-module=http-lua - -mmkir /usr/lib/nginx #workround for clean install -cat > description-pak | Custom build of Nginx with some modules, by EpicMorg. -fakeroot checkinstall -D --pakdir=/builds/export --maintainer="EpicMorg, developer@epicm.org" --pkgname=nginx-custom --install=no -y - -------------- - -final -apt install libzip4 -extract pre.tgz -install debs - -dhparam -out /etc/nginx/ssl/dhparam.pem 4096 diff --git a/balancer/latest/Dockerfile b/balancer/latest/Dockerfile index be9c256a2..5e27afa53 100644 --- a/balancer/latest/Dockerfile +++ b/balancer/latest/Dockerfile @@ -1,40 +1,200 @@ -FROM debian:buster -MAINTAINER Anatoliy Zimovskiy +FROM epicmorg/devel AS builder +LABEL maintainer="EpicMorg DevTeam, developer@epicm.org" +ARG DEBIAN_FRONTEND=noninteractive -ENV DEBIAN_FRONTEND noninteractive +################################################################## +# ARGuments +################################################################## +ENV BuildDocker true +ARG BUILDS_DIR=/builds +ARG SRC_DIR=${BUILDS_DIR}/src +ARG EXPORT_DIR=${BUILDS_DIR}/export +ARG PRE_DIR=${BUILDS_DIR}/pre +ARG NGINX_SRC_DIR=${SRC_DIR}/nginx +ARG NGINX_VERSION=1.17.3 +ARG NGINX_DOWNLOAD_URL=http://nginx.org/download/nginx-${NGINX_VERSION}.tar.gz +ARG LUAJIT_INC=/usr/local/include/luajit-2.1 +ARG LUAJIT_LIB=/usr/local/lib -#editing sources list -RUN rm /etc/apt/sources.list -COPY sources.list /etc/apt/sources.list -COPY locale.gen /etc/locale.gen +################################################################## +# Files and folders +################################################################## +RUN mkdir -p ${PRE_DIR} ${NGINX_SRC_DIR} /usr/lib/nginx +ADD pre/luajit2-description-pak ${PRE_DIR} +ADD pre/nginx-description-pak ${PRE_DIR} -# fix errors -RUN echo 'debconf debconf/frontend select Noninteractive' | debconf-set-selections +################################################################## +# luaJIT 2 support for prod nginx module +################################################################## +RUN cd ${SRC_DIR} && \ + git clone https://github.com/openresty/luajit2.git luajit2 && \ + cp -fv ${PRE_DIR}/luajit2-description-pak ${SRC_DIR}/luajit2/description-pak && \ + cd ${SRC_DIR}/luajit2 && \ + make && \ + make install && \ + fakeroot checkinstall -D --pakdir=${EXPORT_DIR} --maintainer="EpicMorg, developer@epicm.org" --pkgname=luajit2-custom --conflicts=luajit2 --install=no -y -#installing utils -RUN apt-get update && apt-get install -y --allow-unauthenticated ca-certificates gnupg sudo apt-transport-https lsb-release apt-utils locales console-cyrillic wget curl htop mc tmux iftop cmatrix iputils-ping cmatrix-xfont lsof lynx fontconfig smbclient nano +################################################################## +# nginx preparing +################################################################## +RUN wget -qO - ${NGINX_DOWNLOAD_URL} | tar -zxv --strip-components=1 -C ${NGINX_SRC_DIR} && \ + cd ${NGINX_SRC_DIR} && \ + git clone https://github.com/openresty/headers-more-nginx-module.git http-headers-more-filter && \ + git clone https://github.com/sto/ngx_http_auth_pam_module.git http-auth-pam && \ + git clone https://github.com/arut/nginx-dav-ext-module.git http-dav-ext && \ + git clone https://github.com/openresty/echo-nginx-module.git http-echo && \ + git clone https://github.com/aperezdc/ngx-fancyindex.git http-fancyindex && \ + git clone https://github.com/slact/nchan.git nchan && \ + git clone https://github.com/masterzen/nginx-upload-progress-module.git http-uploadprogress && \ + git clone https://github.com/yaoweibin/ngx_http_substitutions_filter_module http-subs-filter && \ + git clone https://github.com/grahamedgecombe/nginx-ct.git ssl-ct && \ + git clone https://github.com/stnoonan/spnego-http-auth-nginx-module.git spnego-http-auth-nginx-module && \ + git clone https://github.com/leev/ngx_http_geoip2_module http-geoip2 && \ + git clone https://github.com/flavioribeiro/nginx-audio-track-for-hls-module.git nginx-audio-track-for-hls-module && \ + git clone https://github.com/chrislim2888/ip2location-nginx.git ip2location-nginx && \ + git clone https://github.com/kaltura/nginx-vod-module.git nginx-vod-module && \ + git clone https://github.com/vozlt/nginx-module-vts.git nginx-module-vts && \ + git clone https://github.com/evanmiller/mod_zip.git mod-zip && \ + git clone https://github.com/alibaba/nginx-http-user-agent.git nginx-http-user-agent && \ + git clone https://github.com/youzee/nginx-unzip-module.git nginx-unzip-module && \ + git clone https://github.com/vladbondarenko/ngx_webp.git ngx-webp && \ + git clone https://github.com/openresty/xss-nginx-module.git xss-nginx-module && \ + git clone https://github.com/openresty/set-misc-nginx-module.git set-misc-nginx-module && \ + git clone https://github.com/arut/nginx-rtmp-module.git rtmp && \ + git clone https://github.com/kvspb/nginx-auth-ldap.git http-auth-ldap && \ + git clone https://github.com/simplresty/ngx_devel_kit.git http-ndk && \ + git clone https://github.com/chrislim2888/IP2Location-C-Library.git ip2location-c-7.0.0 && \ + git clone https://github.com/itoffshore/nginx-upstream-fair.git http-upstream-fair && \ + git clone https://github.com/yaoweibin/nginx_upstream_check_module.git nginx-upstream-check-module && \ + git clone https://github.com/openresty/lua-nginx-module http-lua -#installing nginx repo -RUN wget -O /etc/apt/trusted.gpg.d/nginx-mainline.gpg https://packages.sury.org/nginx-mainline/apt.gpg -RUN sh -c 'echo "deb https://packages.sury.org/nginx-mainline/ buster main" > /etc/apt/sources.list.d/nginx-mainline.list' +################################################################## +# nginx compilling +################################################################## +RUN cd ${NGINX_SRC_DIR} && \ + ./configure \ + --sbin-path=/usr/sbin/nginx \ + --prefix=/usr/share/nginx \ + --conf-path=/etc/nginx/nginx.conf \ + --http-log-path=/var/log/nginx/access.log \ + --error-log-path=/var/log/nginx/error.log \ + --lock-path=/var/lock/nginx.lock \ + --pid-path=/run/nginx.pid \ + --modules-path=/usr/lib/nginx/modules \ + --http-client-body-temp-path=/var/lib/nginx/body \ + --http-fastcgi-temp-path=/var/lib/nginx/fastcgi \ + --http-proxy-temp-path=/var/lib/nginx/proxy \ + --http-scgi-temp-path=/var/lib/nginx/scgi \ + --http-uwsgi-temp-path=/var/lib/nginx/uwsgi \ + --with-cc-opt='-I/usr/local/include/luajit-2.1 -g -O2 -lz -fstack-protector-strong -Wformat -Wno-error=date-time -Wno-error=implicit-fallthrough= -Wno-error=cast-function-type -Wno-error=format-security -Wno-error=implicit-function-declaration -Wno-error=deprecated-declarations -Wno-error=unused-result -fPIC -Wdate-time -D_FORTIFY_SOURCE=2' \ + --with-ld-opt='-Wl,-z,relro -Wl,-z,now -lz -fPIC -L/usr/local/lib' \ + --with-file-aio \ + --with-compat \ + --with-debug \ + --with-threads \ + --with-pcre-jit \ + --with-http_ssl_module \ + --with-http_stub_status_module \ + --with-http_realip_module \ + --with-http_auth_request_module \ + --with-http_v2_module \ + --with-http_dav_module \ + --with-http_slice_module \ + --with-http_addition_module \ + --with-http_flv_module \ + --with-http_geoip_module=dynamic \ + --with-http_gunzip_module \ + --with-http_gzip_static_module \ + --with-http_image_filter_module=dynamic \ + --with-http_mp4_module \ + --with-http_perl_module=dynamic \ + --with-http_random_index_module \ + --with-http_secure_link_module \ + --with-http_sub_module \ + --with-http_xslt_module=dynamic \ + --with-mail=dynamic \ + --with-mail_ssl_module \ + --with-stream=dynamic \ + --with-stream_ssl_module \ + --with-stream_ssl_preread_module \ + --add-dynamic-module=http-headers-more-filter \ + --add-dynamic-module=http-auth-pam \ + --add-dynamic-module=http-dav-ext \ + --add-dynamic-module=http-ndk \ + --add-dynamic-module=http-echo \ + --add-dynamic-module=http-fancyindex \ + --add-dynamic-module=nchan \ + --add-dynamic-module=http-uploadprogress \ + --add-dynamic-module=http-subs-filter \ + --add-dynamic-module=ssl-ct \ + --add-dynamic-module=http-geoip2 \ + --add-dynamic-module=spnego-http-auth-nginx-module \ + --add-dynamic-module=http-auth-ldap \ + --add-dynamic-module=nginx-audio-track-for-hls-module \ + --add-dynamic-module=ip2location-nginx \ + --add-dynamic-module=nginx-vod-module \ + --add-dynamic-module=nginx-module-vts \ + --add-dynamic-module=mod-zip \ + --add-dynamic-module=nginx-http-user-agent \ + --add-dynamic-module=nginx-unzip-module \ + --add-dynamic-module=ngx-webp \ + --add-dynamic-module=set-misc-nginx-module \ + --add-dynamic-module=rtmp \ + --add-dynamic-module=http-upstream-fair \ + --add-dynamic-module=nginx-upstream-check-module \ + --add-dynamic-module=http-lua && \ + cp -fv ${PRE_DIR}/nginx-description-pak ${NGINX_SRC_DIR}/description-pak && \ + fakeroot checkinstall -D --pakdir=/builds/export --maintainer="EpicMorg, developer@epicm.org" --pkgname=nginx-custom --install=no -y -#installing packages -RUN apt-get update && apt-get install -y --allow-unauthenticated libgd-tools geoip-bin nginx-doc ssl-cert nginx-extras openssl libnginx-mod-http-cache-purge libnginx-mod-http-dav-ext libnginx-mod-http-geoip libnginx-mod-http-headers-more-filter libnginx-mod-http-lua libnginx-mod-http-uploadprogress libnginx-mod-mail libnginx-mod-stream libnginx-mod-http-xslt-filter +################################################################## +# cleaninig up +################################################################## +RUN apt clean -y && \ + apt autoclean -y && \ + rm -rfv /var/lib/apt/lists/* && \ + rm -rfv /var/cache/apt/archives/*.deb -RUN ln -sf /dev/stdout /var/log/nginx/access.log && \ - ln -sf /dev/stderr /var/log/nginx/error.log +################################################################## +################################################################## +################################################################## -#After install fixes -RUN localedef en_US.UTF-8 -i en_US -f UTF-8 -RUN update-locale LC_ALL=en_US.UTF-8 LANG=en_US.UTF-8 -RUN apt update -RUN apt upgrade -y -RUN apt dist-upgrade -y -RUN apt-get clean autoclean -RUN apt-get autoremove -y -RUN rm -rf /var/lib/apt/lists/* +FROM epicmorg/prod +LABEL maintainer="EpicMorg DevTeam, developer@epicm.org" +ARG DEBIAN_FRONTEND=noninteractive -#final config +################################################################## +# Installing nginx from deb +################################################################## +ADD pre/ngninx.pre.tar.gz / +COPY --from=builder /builds/export /tmp/deb +RUN apt-get update && \ + apt-get install -y --allow-unauthenticated \ + geoip-database \ + geoip-bin \ + libgeoip1 \ + libmaxminddb0 \ + libgd3 \ + libxslt1.1 && \ + dpkg --force-all -i /tmp/deb/*.deb && \ + ln -s /usr/local/lib/libIP2Location.so /usr/lib/libIP2Location.so && \ + ln -s /usr/local/lib/libIP2Location.so.1 /usr/lib/libIP2Location.so.1 && \ + ln -s /usr/local/lib/libIP2Location.so /lib/libIP2Location.so && \ + ln -s /usr/local/lib/libIP2Location.so.1 /lib/libIP2Location.so.1 && \ + ln -sf /dev/stdout /var/log/nginx/access.log && \ + ln -sf /dev/stderr /var/log/nginx/error.log && \ + openssl dhparam -out /etc/nginx/dhparam.pem 4096 + + +################################################################## +# cleaninig up +################################################################## +RUN apt clean -y && \ + apt autoclean -y && \ + rm -rfv /var/lib/apt/lists/* && \ + rm -rfv /var/cache/apt/archives/*.deb && \ + rm -rfv /tmp/deb/* + +#Final config VOLUME ["/var/cache/nginx"] EXPOSE 80 443 diff --git a/balancer/latest/Makefile b/balancer/latest/Makefile index 9ae7d56da..fe0a0414d 100644 --- a/balancer/latest/Makefile +++ b/balancer/latest/Makefile @@ -1,4 +1,4 @@ all: nginx nginx: - docker build --compress -t epicmorg/balancer . + docker build --compress -t epicmorg/balancer:latest . diff --git a/balancer/experemental/pre/luajit2-description-pak b/balancer/latest/pre/luajit2-description-pak similarity index 100% rename from balancer/experemental/pre/luajit2-description-pak rename to balancer/latest/pre/luajit2-description-pak diff --git a/balancer/experemental/pre/nginx-description-pak b/balancer/latest/pre/nginx-description-pak similarity index 100% rename from balancer/experemental/pre/nginx-description-pak rename to balancer/latest/pre/nginx-description-pak diff --git a/balancer/experemental/pre/ngninx.pre.tar.gz b/balancer/latest/pre/ngninx.pre.tar.gz similarity index 100% rename from balancer/experemental/pre/ngninx.pre.tar.gz rename to balancer/latest/pre/ngninx.pre.tar.gz diff --git a/balancer/experemental/.docker-repository.yml b/balancer/legacy/.docker-repository.yml similarity index 100% rename from balancer/experemental/.docker-repository.yml rename to balancer/legacy/.docker-repository.yml diff --git a/balancer/experemental/.dockerignore b/balancer/legacy/.dockerignore similarity index 100% rename from balancer/experemental/.dockerignore rename to balancer/legacy/.dockerignore diff --git a/balancer/legacy/Dockerfile b/balancer/legacy/Dockerfile new file mode 100644 index 000000000..be9c256a2 --- /dev/null +++ b/balancer/legacy/Dockerfile @@ -0,0 +1,41 @@ +FROM debian:buster +MAINTAINER Anatoliy Zimovskiy + +ENV DEBIAN_FRONTEND noninteractive + +#editing sources list +RUN rm /etc/apt/sources.list +COPY sources.list /etc/apt/sources.list +COPY locale.gen /etc/locale.gen + +# fix errors +RUN echo 'debconf debconf/frontend select Noninteractive' | debconf-set-selections + +#installing utils +RUN apt-get update && apt-get install -y --allow-unauthenticated ca-certificates gnupg sudo apt-transport-https lsb-release apt-utils locales console-cyrillic wget curl htop mc tmux iftop cmatrix iputils-ping cmatrix-xfont lsof lynx fontconfig smbclient nano + +#installing nginx repo +RUN wget -O /etc/apt/trusted.gpg.d/nginx-mainline.gpg https://packages.sury.org/nginx-mainline/apt.gpg +RUN sh -c 'echo "deb https://packages.sury.org/nginx-mainline/ buster main" > /etc/apt/sources.list.d/nginx-mainline.list' + +#installing packages +RUN apt-get update && apt-get install -y --allow-unauthenticated libgd-tools geoip-bin nginx-doc ssl-cert nginx-extras openssl libnginx-mod-http-cache-purge libnginx-mod-http-dav-ext libnginx-mod-http-geoip libnginx-mod-http-headers-more-filter libnginx-mod-http-lua libnginx-mod-http-uploadprogress libnginx-mod-mail libnginx-mod-stream libnginx-mod-http-xslt-filter + +RUN ln -sf /dev/stdout /var/log/nginx/access.log && \ + ln -sf /dev/stderr /var/log/nginx/error.log + +#After install fixes +RUN localedef en_US.UTF-8 -i en_US -f UTF-8 +RUN update-locale LC_ALL=en_US.UTF-8 LANG=en_US.UTF-8 +RUN apt update +RUN apt upgrade -y +RUN apt dist-upgrade -y +RUN apt-get clean autoclean +RUN apt-get autoremove -y +RUN rm -rf /var/lib/apt/lists/* + +#final config +VOLUME ["/var/cache/nginx"] +EXPOSE 80 443 + +CMD ["nginx", "-g", "daemon off;"] diff --git a/balancer/legacy/Makefile b/balancer/legacy/Makefile new file mode 100644 index 000000000..bd56b1ec0 --- /dev/null +++ b/balancer/legacy/Makefile @@ -0,0 +1,4 @@ +all: nginx + +nginx: + docker build --compress -t epicmorg/balancer:legacy . diff --git a/balancer/experemental/README.md b/balancer/legacy/README.md similarity index 100% rename from balancer/experemental/README.md rename to balancer/legacy/README.md diff --git a/balancer/latest/locale.gen b/balancer/legacy/locale.gen similarity index 100% rename from balancer/latest/locale.gen rename to balancer/legacy/locale.gen diff --git a/balancer/latest/sources.list b/balancer/legacy/sources.list similarity index 100% rename from balancer/latest/sources.list rename to balancer/legacy/sources.list diff --git a/balancer/php/.docker-repository.yml b/balancer/php/.docker-repository.yml new file mode 100644 index 000000000..6bf9e2675 --- /dev/null +++ b/balancer/php/.docker-repository.yml @@ -0,0 +1 @@ +repository: epicmorg/balancer diff --git a/balancer/php/.dockerignore b/balancer/php/.dockerignore new file mode 100644 index 000000000..f5523d40c --- /dev/null +++ b/balancer/php/.dockerignore @@ -0,0 +1,3 @@ +.git +scripts +.idea diff --git a/balancer/php/Dockerfile b/balancer/php/Dockerfile new file mode 100644 index 000000000..b0e3c16d0 --- /dev/null +++ b/balancer/php/Dockerfile @@ -0,0 +1,136 @@ +FROM epicmorg/balancer:latest +LABEL maintainer="EpicMorg DevTeam, developer@epicm.org" +ARG DEBIAN_FRONTEND=noninteractive + +################################################################## +# Installing php fpn for nginx from deb +################################################################## +RUN wget -O /etc/apt/trusted.gpg.d/php.gpg https://packages.sury.org/php/apt.gpg && \ + sh -c 'echo "deb https://packages.sury.org/php/ buster main" > /etc/apt/sources.list.d/php.list' && \ + apt-get update && \ + apt-get install -y --allow-unauthenticated \ + apache2-utils \ + libmemcached-dev \ + sendmail \ + php7.3-gmp \ + php7.3-snmp \ + php7.3-ldap \ + php7.3-dev \ + php7.3 \ + php7.3-mail \ + php7.3-mailparse \ + php7.3-soap \ + php7.3-mysql \ + php7.3-memcached \ + php7.3-memcache \ + php7.3-igbinary \ + php7.3-curl \ + php7.3-gd \ + php7.3-intl \ + php7.3-zip \ + php7.3-bcmath \ + php7.3-fpm \ + php-pear \ + php7.3-imap \ + php7.3-pspell \ + php7.3-recode \ + php7.3-sqlite3 \ + php7.3-tidy \ + php7.3-xmlrpc \ + php7.3-xml \ + php7.3-mbstring \ + php7.3-gettext \ + php7.3-apcu \ + php7.3-cli \ + php7.3-common \ + php7.3-cgi \ + php7.3-json \ + php7.3-readline \ + php7.3-enchant \ + php7.3-ssh2 \ + php7.3-oauth \ + php7.3-gmagick \ + php7.3-gnupg \ + php7.3-redis \ + php7.3-smbclient \ + php7.3-yaml \ + php7.3-geoip + +################################################################## +# Enabling php modules +################################################################## +RUN phpenmod \ + snmp \ + gmp \ + calendar \ + ldap \ + curl \ + exif \ + ftp \ + fileinfo \ + gd \ + geoip \ + gettext \ + gnupg \ + iconv \ + imap \ + json \ + mbstring \ + memcached \ + mysqli \ + mysqlnd \ + oauth \ + pdo_mysql \ + pdo_sqlite \ + phar \ + posix \ + readline \ + redis \ + simplexml \ + sockets \ + sqlite3 \ + ssh2 \ + tokenizer \ + xml \ + xmlreader \ + xmlrpc \ + xmlwriter \ + xsl \ + yaml + +################################################################## +# ioncube support +################################################################## +ADD https://downloads.ioncube.com/loader_downloads/ioncube_loaders_lin_x86-64.tar.gz /tmp/ioncube.tar.gz +RUN tar -C /tmp -xvf /tmp/ioncube.tar.gz && \ + cp /tmp/ioncube/ioncube_loader_lin_7.3.so /usr/lib/php/20170718/ && \ + echo "zend_extension = /usr/lib/php/20170718/ioncube_loader_lin_7.3.so" >> /etc/php/7.3/apache2/php.ini && \ + echo "zend_extension = /usr/lib/php/20170718/ioncube_loader_lin_7.3.so" >> /etc/php/7.3/cgi/php.ini && \ + echo "zend_extension = /usr/lib/php/20170718/ioncube_loader_lin_7.3.so" >> /etc/php/7.3/cli/php.ini && \ + echo "zend_extension = /usr/lib/php/20170718/ioncube_loader_lin_7.3.so" >> /etc/php/7.3/fpm/php.ini && \ + php -v + +################################################################## +# composer support +################################################################## +RUN cd /tmp && \ + php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" && \ + php composer-setup.php --install-dir=/usr/local/bin --filename=composer && \ + rm /tmp/composer-setup.php + +################################################################## +# cleaninig up +################################################################## +RUN apt clean -y && \ + apt autoclean -y && \ + rm -rfv /var/lib/apt/lists/* && \ + rm -rfv /var/cache/apt/archives/*.deb && \ + rm -rfv /tmp/deb/* && \ + rm -rfv /tmp/composer-setup.php && \ + rm -rfv /tmp/ioncube.tar.gz + +#Final config +VOLUME ["/var/cache/nginx"] +EXPOSE 80 443 + +CMD ["nginx", "-g", "daemon off;"] diff --git a/balancer/php/Makefile b/balancer/php/Makefile new file mode 100644 index 000000000..c65f48c72 --- /dev/null +++ b/balancer/php/Makefile @@ -0,0 +1,4 @@ +all: nginx + +nginx: + docker build --compress -t epicmorg/balancer:php . diff --git a/balancer/php/README.md b/balancer/php/README.md new file mode 100644 index 000000000..034784bc0 --- /dev/null +++ b/balancer/php/README.md @@ -0,0 +1,30 @@ +# Compose example + +```yml +version: '3.7' +services: + balancer: + image: epicmorg/balancer + restart: unless-stopped + ports: + - "0.0.0.0:80:80" + - "0.0.0.0:443:443" + volumes: + - /etc/localtime:/etc/localtime + - /etc/timezone:/etc/timezone + - /etc/letsencrypt:/etc/letsencrypt + - nginx:/etc/nginx + - nginx-usr:/usr/share/nginx/html + - /var/lib/nginx +# extra_hosts: +# - "example.com:192.168.0.11" + depends_on: + - websites + tmpfs: + - /tmp +volumes: + nginx: + external: true + nginx-usr: + external: true +```