Skip to content

Commit 2e11991

Browse files
committed
feat: Support ngx_http_geoip2_module
1 parent 42a09f7 commit 2e11991

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

Dockerfile

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ ENV php_vars /usr/local/etc/php/conf.d/docker-vars.ini
99
ENV NGINX_VERSION 1.16.0
1010
ENV LUA_MODULE_VERSION 0.10.14
1111
ENV DEVEL_KIT_MODULE_VERSION 0.3.0
12+
ENV GEOIP2_MODULE_VERSION 3.2
1213
ENV LUAJIT_LIB=/usr/lib
1314
ENV LUAJIT_INC=/usr/include/luajit-2.1
1415

@@ -64,6 +65,7 @@ RUN GPG_KEYS=B0F4253373F8F6F510D42178520A9993A1C052F8 \
6465
--with-http_v2_module \
6566
--add-module=/usr/src/ngx_devel_kit-$DEVEL_KIT_MODULE_VERSION \
6667
--add-module=/usr/src/lua-nginx-module-$LUA_MODULE_VERSION \
68+
--add-module=/usr/src/ngx_http_geoip2_module-$GEOIP2_MODULE_VERSION \
6769
" \
6870
&& addgroup -S nginx \
6971
&& adduser -D -S -h /var/cache/nginx -s /sbin/nologin -G nginx nginx \
@@ -81,12 +83,14 @@ RUN GPG_KEYS=B0F4253373F8F6F510D42178520A9993A1C052F8 \
8183
libxslt-dev \
8284
gd-dev \
8385
geoip-dev \
86+
libmaxminddb-dev \
8487
perl-dev \
8588
luajit-dev \
8689
&& curl -fSL http://nginx.org/download/nginx-$NGINX_VERSION.tar.gz -o nginx.tar.gz \
8790
&& curl -fSL http://nginx.org/download/nginx-$NGINX_VERSION.tar.gz.asc -o nginx.tar.gz.asc \
8891
&& curl -fSL https://github.com/simpl/ngx_devel_kit/archive/v$DEVEL_KIT_MODULE_VERSION.tar.gz -o ndk.tar.gz \
8992
&& curl -fSL https://github.com/openresty/lua-nginx-module/archive/v$LUA_MODULE_VERSION.tar.gz -o lua.tar.gz \
93+
&& curl -fSL https://github.com/leev/ngx_http_geoip2_module/archive/$GEOIP2_MODULE_VERSION.tar.gz -o ngx_http_geoip2_module.tar.gz \
9094
&& export GNUPGHOME="$(mktemp -d)" \
9195
&& found=''; \
9296
for server in \
@@ -105,7 +109,8 @@ RUN GPG_KEYS=B0F4253373F8F6F510D42178520A9993A1C052F8 \
105109
&& tar -zxC /usr/src -f nginx.tar.gz \
106110
&& tar -zxC /usr/src -f ndk.tar.gz \
107111
&& tar -zxC /usr/src -f lua.tar.gz \
108-
&& rm nginx.tar.gz ndk.tar.gz lua.tar.gz \
112+
&& tar -zxC /usr/src -f ngx_http_geoip2_module.tar.gz \
113+
&& rm nginx.tar.gz ndk.tar.gz lua.tar.gz ngx_http_geoip2_module.tar.gz \
109114
&& cd /usr/src/nginx-$NGINX_VERSION \
110115
&& ./configure $CONFIG --with-debug \
111116
&& make -j$(getconf _NPROCESSORS_ONLN) \
@@ -133,6 +138,7 @@ RUN GPG_KEYS=B0F4253373F8F6F510D42178520A9993A1C052F8 \
133138
&& strip /usr/sbin/nginx* \
134139
&& strip /usr/lib/nginx/modules/*.so \
135140
&& rm -rf /usr/src/nginx-$NGINX_VERSION \
141+
&& rm -rf /usr/src/ngx_http_geoip2_module-$GEOIP2_MODULE_VERSION \
136142
\
137143
# Bring in gettext so we can get `envsubst`, then throw
138144
# the rest away. To do this, we need to install `gettext`

0 commit comments

Comments
 (0)