1- FROM alpine:3.12
2- MAINTAINER Thomas Spicer (thomas@openbridge.com)
1+ FROM alpine:3.18
2+ LABEL maintainer= " Thomas Spicer (thomas@openbridge.com)"
33
44ARG NGINX_VERSION
55ENV VAR_PREFIX=/var/run \
@@ -13,7 +13,6 @@ RUN set -x \
1313 && CONFIG="\
1414 --prefix=/usr/share/nginx/ \
1515 --sbin-path=/usr/sbin/nginx \
16- --add-module=/tmp/naxsi/naxsi_src \
1716 --modules-path=/usr/lib/nginx/modules \
1817 --conf-path=${CONF_PREFIX}/nginx.conf \
1918 --error-log-path=${LOG_PREFIX}/error.log \
@@ -43,32 +42,30 @@ RUN set -x \
4342 --with-http_auth_request_module \
4443 --with-http_xslt_module=dynamic \
4544 --with-http_image_filter_module=dynamic \
46- --with-http_geoip_module=dynamic \
4745 --with-threads \
4846 --with-stream \
4947 --with-stream_ssl_module \
5048 --with-stream_ssl_preread_module \
5149 --with-stream_realip_module \
52- --with-stream_geoip_module=dynamic \
5350 --with-http_slice_module \
5451 --with-mail \
5552 --with-mail_ssl_module \
5653 --with-compat \
5754 --with-file-aio \
5855 --with-http_v2_module \
5956 --add-module=/tmp/ngx_cache_purge-2.3 \
60- --add-module=/tmp/ngx_http_redis-0.3.9 \
57+ --add-module=/tmp/ngx_http_redis-0.4.1-cmm \
6158 --add-module=/tmp/redis2-nginx-module-0.15 \
62- --add-module=/tmp/srcache-nginx-module-0.31 \
59+ --add-module=/tmp/srcache-nginx-module-0.33 \
6360 --add-module=/tmp/echo-nginx-module \
64- --add-module=/tmp/ngx_devel_kit-0.3.1 \
65- --add-module=/tmp/set-misc-nginx-module-0.32 \
61+ --add-module=/tmp/ngx_devel_kit-0.3.2 \
62+ --add-module=/tmp/set-misc-nginx-module-0.33 \
6663 --add-module=/tmp/ngx_brotli \
6764 --with-ld-opt='-L/usr/lib' \
6865 --with-cc-opt=-Wno-error \
6966 " \
70- && addgroup -g 82 -S www-data \
71- && adduser -u 82 -D -S -h /var/cache/nginx -s /sbin/nologin -G www-data www-data \
67+ && if [ -z "$(getent group www-data)" ]; then addgroup -g 82 -S www-data; fi \
68+ && if [ -z "$(getent passwd www-data)" ]; then adduser -u 82 -D -S -h /var/cache/nginx -s /sbin/nologin -G www-data www-data; fi \
7269 && apk add --no-cache --virtual .build-deps \
7370 alpine-sdk \
7471 autoconf \
@@ -81,7 +78,6 @@ RUN set -x \
8178 findutils \
8279 gcc \
8380 gd-dev \
84- geoip-dev \
8581 gettext \
8682 git \
8783 gnupg \
@@ -108,7 +104,6 @@ RUN set -x \
108104 bash \
109105 bind-tools \
110106 rsync \
111- geoip \
112107 openssl \
113108 pcre \
114109 tini \
@@ -118,29 +113,19 @@ RUN set -x \
118113 && cd ngx_brotli && git submodule update --init \
119114 && export NGX_BROTLI_STATIC_MODULE_ONLY=1 \
120115 && cd /tmp \
121- && git clone https://github.com/nbs-system/naxsi.git \
122- && echo 'adding /usr/local/share/GeoIP/GeoIP.dat database' \
123- && wget -N https://raw.githubusercontent.com/openbridge/nginx/master/geoip/GeoLiteCity.dat.gz \
124- && wget -N https://raw.githubusercontent.com/openbridge/nginx/master/geoip/GeoIP.dat.gz \
125- && gzip -d GeoIP.dat.gz \
126- && gzip -d GeoLiteCity.dat.gz \
127- && mkdir /usr/local/share/GeoIP/ \
128- && mv GeoIP.dat /usr/local/share/GeoIP/ \
129- && mv GeoLiteCity.dat /usr/local/share/GeoIP/ \
130- && chown -R www-data:www-data /usr/local/share/GeoIP/ \
131116 && curl -fSL http://nginx.org/download/nginx-$NGINX_VERSION.tar.gz -o nginx.tar.gz \
132117 && mkdir -p /usr/src \
133118 && tar -zxC /usr/src -f nginx.tar.gz \
134119 && rm nginx.tar.gz \
135120 && cd /tmp \
136121 && git clone https://github.com/openresty/echo-nginx-module.git \
137- && wget https://github.com/simpl /ngx_devel_kit/archive/v0.3.1 .zip -O dev.zip \
138- && wget https://github.com/openresty/set-misc-nginx-module/archive/v0.32 .zip -O setmisc.zip \
139- && wget https://people.freebsd.org/~osa /ngx_http_redis-0.3.9.tar.gz \
140- && wget https://github.com/openresty/redis2-nginx-module/archive/v0.15.zip -O redis.zip \
141- && wget https://github.com/openresty/srcache-nginx-module/archive/v0.31 .zip -O cache.zip \
142- && wget https://github.com/FRiCKLE/ngx_cache_purge/archive/2.3.zip -O purge.zip \
143- && tar -zx -f ngx_http_redis-0.3.9.tar.gz \
122+ && wget https://github.com/vision5 /ngx_devel_kit/archive/refs/tags/ v0.3.2 .zip -O dev.zip \
123+ && wget https://github.com/openresty/set-misc-nginx-module/archive/refs/tags/ v0.33 .zip -O setmisc.zip \
124+ && wget https://github.com/centminmod /ngx_http_redis/archive/refs/tags/0.4.1-cmm.zip -O ngx.zip \
125+ && wget https://github.com/openresty/redis2-nginx-module/archive/refs/tags/ v0.15.zip -O redis.zip \
126+ && wget https://github.com/openresty/srcache-nginx-module/archive/refs/tags/ v0.33 .zip -O cache.zip \
127+ && wget https://github.com/FRiCKLE/ngx_cache_purge/archive/refs/tags/ 2.3.zip -O purge.zip \
128+ && unzip ngx.zip \
144129 && unzip dev.zip \
145130 && unzip setmisc.zip \
146131 && unzip redis.zip \
@@ -152,7 +137,6 @@ RUN set -x \
152137 && mv objs/nginx objs/nginx-debug \
153138 && mv objs/ngx_http_xslt_filter_module.so objs/ngx_http_xslt_filter_module-debug.so \
154139 && mv objs/ngx_http_image_filter_module.so objs/ngx_http_image_filter_module-debug.so \
155- && mv objs/ngx_stream_geoip_module.so objs/ngx_stream_geoip_module-debug.so \
156140 && ./configure $CONFIG \
157141 && make -j$(getconf _NPROCESSORS_ONLN) \
158142 && make install \
@@ -164,7 +148,6 @@ RUN set -x \
164148 && install -m755 objs/nginx-debug /usr/sbin/nginx-debug \
165149 && install -m755 objs/ngx_http_xslt_filter_module-debug.so /usr/lib/nginx/modules/ngx_http_xslt_filter_module-debug.so \
166150 && install -m755 objs/ngx_http_image_filter_module-debug.so /usr/lib/nginx/modules/ngx_http_image_filter_module-debug.so \
167- && install -m755 objs/ngx_stream_geoip_module-debug.so /usr/lib/nginx/modules/ngx_stream_geoip_module-debug.so \
168151 && ln -s ../../usr/lib/nginx/modules /etc/nginx/modules \
169152 && strip /usr/sbin/nginx* \
170153 && strip /usr/lib/nginx/modules/*.so \
@@ -185,8 +168,6 @@ RUN set -x \
185168 && nice -n +5 openssl dhparam -out /etc/pki/tls/dhparam.pem.default 2048 \
186169 && apk add --no-cache $runDeps \
187170 && apk del .build-deps \
188- && cd /tmp/naxsi \
189- && mv naxsi_config/naxsi_core.rules /etc/nginx/naxsi_core.rules \
190171 && rm -rf /tmp/* \
191172 && rm -rf /usr/src/* \
192173 && ln -sf /dev/stdout ${LOG_PREFIX}/access.log \
0 commit comments