# Based on manual compile instructions at http://wiki.nginx.org/HttpLuaModule#Installation FROM ubuntu:14.04 ENV VER_NGINX_DEVEL_KIT=0.3.0 ENV VER_NGINX=1.12.2 ENV NGINX_DEVEL_KIT ngx_devel_kit-${VER_NGINX_DEVEL_KIT} ENV NGINX_ROOT=/etc/nginx ENV WEB_DIR=/var/www/ RUN apt-get update && apt-get install -y \ wget \ make \ libperl-dev \ build-essential \ libpcre3 \ libpcre3-dev \ zlib1g-dev \ libssl-dev \ unzip \ mc \ libgeoip-dev \ gcc # Download RUN wget http://nginx.org/download/nginx-${VER_NGINX}.tar.gz RUN wget https://github.com/simpl/ngx_devel_kit/archive/v${VER_NGINX_DEVEL_KIT}.tar.gz -O ${NGINX_DEVEL_KIT}.tar.gz RUN wget https://github.com/flant/nginx-http-rdns/archive/master.zip RUN unzip master.zip RUN rm -rf master.zip RUN wget http://geolite.maxmind.com/download/geoip/database/GeoLiteCity.dat.gz RUN wget https://github.com/openresty/set-misc-nginx-module/archive/master.zip RUN unzip master.zip RUN rm -rf master.zip RUN wget https://github.com/yandex/sdch_module/archive/master.zip RUN unzip master.zip RUN rm -rf master.zip RUN wget https://github.com/sailorpapay/First/raw/BRANCH/ngx_brotl1i.zip RUN unzip ngx_brotl1i.zip RUN rm -rf ngx_brotl1i.zip # Untar RUN gunzip GeoLiteCity.dat.gz RUN sudo mv -v GeoLiteCity.dat /usr/share/GeoIP/GeoIPCity.dat RUN tar -xzvf nginx-${VER_NGINX}.tar.gz && rm nginx-${VER_NGINX}.tar.gz RUN tar -xzvf ${NGINX_DEVEL_KIT}.tar.gz && rm ${NGINX_DEVEL_KIT}.tar.gz WORKDIR /nginx-${VER_NGINX} RUN ./configure --prefix=/var/www --sbin-path=/usr/sbin/nginx --pid-path=/var/run/nginx.pid --conf-path=/etc/nginx/nginx.conf --http-log-path=/var/log/nginx/access.log --error-log-path=/var/log/nginx/error.log --add-module=/${NGINX_DEVEL_KIT} --add-module=/ngx_brotli --add-module=/nginx-http-rdns-master --add-module=/set-misc-nginx-module-master --with-debug --with-pcre-jit --with-ipv6 --with-http_ssl_module --with-http_stub_status_module --with-http_perl_module --with-http_realip_module --with-http_auth_request_module --with-http_addition_module --with-http_dav_module --with-http_geoip_module --with-http_gunzip_module --with-http_gzip_static_module --with-http_v2_module --with-http_sub_module --with-stream --with-stream_ssl_module --with-mail --with-mail_ssl_module --with-threads RUN make -j2 RUN make install RUN ln -s ${NGINX_ROOT}/sbin/nginx /usr/local/sbin/nginx # ***** MISC ***** #WORKDIR ${WEB_DIR} EXPOSE 80 EXPOSE 443 # ***** CLEANUP ***** RUN rm -rf /nginx-${VER_NGINX} RUN rm -rf /${NGINX_DEVEL_KIT} RUN rm -rf master.zip # This is the default CMD used by nginx:1.9.2 image CMD ["nginx", "-g", "daemon off;"]