updated to php 7.4.2 but geoip is broken - to fix

This commit is contained in:
ric
2020-02-03 22:08:43 +00:00
parent 218147f77a
commit 5f7fcc2d5f
6 changed files with 84 additions and 77 deletions

View File

@@ -1,4 +1,4 @@
FROM php:7.3.9-fpm-alpine3.10 FROM php:7.4.2-fpm-alpine3.11
LABEL maintainer="Ric Harvey <ric@ngd.io>" LABEL maintainer="Ric Harvey <ric@ngd.io>"
@@ -49,14 +49,14 @@ RUN GPG_KEYS=B0F4253373F8F6F510D42178520A9993A1C052F8 \
--with-http_auth_request_module \ --with-http_auth_request_module \
--with-http_xslt_module=dynamic \ --with-http_xslt_module=dynamic \
--with-http_image_filter_module=dynamic \ --with-http_image_filter_module=dynamic \
--with-http_geoip_module=dynamic \ # --with-http_geoip_module=dynamic \
--with-http_perl_module=dynamic \ --with-http_perl_module=dynamic \
--with-threads \ --with-threads \
--with-stream \ --with-stream \
--with-stream_ssl_module \ --with-stream_ssl_module \
--with-stream_ssl_preread_module \ --with-stream_ssl_preread_module \
--with-stream_realip_module \ --with-stream_realip_module \
--with-stream_geoip_module=dynamic \ # --with-stream_geoip_module=dynamic \
--with-http_slice_module \ --with-http_slice_module \
--with-mail \ --with-mail \
--with-mail_ssl_module \ --with-mail_ssl_module \
@@ -65,7 +65,7 @@ RUN GPG_KEYS=B0F4253373F8F6F510D42178520A9993A1C052F8 \
--with-http_v2_module \ --with-http_v2_module \
--add-module=/usr/src/ngx_devel_kit-$DEVEL_KIT_MODULE_VERSION \ --add-module=/usr/src/ngx_devel_kit-$DEVEL_KIT_MODULE_VERSION \
--add-module=/usr/src/lua-nginx-module-$LUA_MODULE_VERSION \ --add-module=/usr/src/lua-nginx-module-$LUA_MODULE_VERSION \
--add-module=/usr/src/ngx_http_geoip2_module-$GEOIP2_MODULE_VERSION \ # --add-module=/usr/src/ngx_http_geoip2_module-$GEOIP2_MODULE_VERSION \
" \ " \
&& addgroup -S nginx \ && addgroup -S nginx \
&& adduser -D -S -h /var/cache/nginx -s /sbin/nologin -G nginx nginx \ && adduser -D -S -h /var/cache/nginx -s /sbin/nologin -G nginx nginx \
@@ -82,7 +82,7 @@ RUN GPG_KEYS=B0F4253373F8F6F510D42178520A9993A1C052F8 \
gnupg \ gnupg \
libxslt-dev \ libxslt-dev \
gd-dev \ gd-dev \
geoip-dev \ # geoip-dev \
libmaxminddb-dev \ libmaxminddb-dev \
perl-dev \ perl-dev \
luajit-dev \ luajit-dev \
@@ -90,7 +90,7 @@ RUN GPG_KEYS=B0F4253373F8F6F510D42178520A9993A1C052F8 \
&& curl -fSL http://nginx.org/download/nginx-$NGINX_VERSION.tar.gz.asc -o nginx.tar.gz.asc \ && curl -fSL http://nginx.org/download/nginx-$NGINX_VERSION.tar.gz.asc -o nginx.tar.gz.asc \
&& curl -fSL https://github.com/simpl/ngx_devel_kit/archive/v$DEVEL_KIT_MODULE_VERSION.tar.gz -o ndk.tar.gz \ && curl -fSL https://github.com/simpl/ngx_devel_kit/archive/v$DEVEL_KIT_MODULE_VERSION.tar.gz -o ndk.tar.gz \
&& curl -fSL https://github.com/openresty/lua-nginx-module/archive/v$LUA_MODULE_VERSION.tar.gz -o lua.tar.gz \ && curl -fSL https://github.com/openresty/lua-nginx-module/archive/v$LUA_MODULE_VERSION.tar.gz -o lua.tar.gz \
&& curl -fSL https://github.com/leev/ngx_http_geoip2_module/archive/$GEOIP2_MODULE_VERSION.tar.gz -o ngx_http_geoip2_module.tar.gz \ # && curl -fSL https://github.com/leev/ngx_http_geoip2_module/archive/$GEOIP2_MODULE_VERSION.tar.gz -o ngx_http_geoip2_module.tar.gz \
&& export GNUPGHOME="$(mktemp -d)" \ && export GNUPGHOME="$(mktemp -d)" \
&& found=''; \ && found=''; \
for server in \ for server in \
@@ -109,17 +109,17 @@ RUN GPG_KEYS=B0F4253373F8F6F510D42178520A9993A1C052F8 \
&& tar -zxC /usr/src -f nginx.tar.gz \ && tar -zxC /usr/src -f nginx.tar.gz \
&& tar -zxC /usr/src -f ndk.tar.gz \ && tar -zxC /usr/src -f ndk.tar.gz \
&& tar -zxC /usr/src -f lua.tar.gz \ && tar -zxC /usr/src -f lua.tar.gz \
&& tar -zxC /usr/src -f ngx_http_geoip2_module.tar.gz \ # && tar -zxC /usr/src -f ngx_http_geoip2_module.tar.gz \
&& rm nginx.tar.gz ndk.tar.gz lua.tar.gz ngx_http_geoip2_module.tar.gz \ # && rm nginx.tar.gz ndk.tar.gz lua.tar.gz ngx_http_geoip2_module.tar.gz \
&& cd /usr/src/nginx-$NGINX_VERSION \ && cd /usr/src/nginx-$NGINX_VERSION \
&& ./configure $CONFIG --with-debug \ && ./configure $CONFIG --with-debug \
&& make -j$(getconf _NPROCESSORS_ONLN) \ && make -j$(getconf _NPROCESSORS_ONLN) \
&& mv objs/nginx objs/nginx-debug \ && mv objs/nginx objs/nginx-debug \
&& mv objs/ngx_http_xslt_filter_module.so objs/ngx_http_xslt_filter_module-debug.so \ && mv objs/ngx_http_xslt_filter_module.so objs/ngx_http_xslt_filter_module-debug.so \
&& mv objs/ngx_http_image_filter_module.so objs/ngx_http_image_filter_module-debug.so \ && mv objs/ngx_http_image_filter_module.so objs/ngx_http_image_filter_module-debug.so \
&& mv objs/ngx_http_geoip_module.so objs/ngx_http_geoip_module-debug.so \ # && mv objs/ngx_http_geoip_module.so objs/ngx_http_geoip_module-debug.so \
&& mv objs/ngx_http_perl_module.so objs/ngx_http_perl_module-debug.so \ && mv objs/ngx_http_perl_module.so objs/ngx_http_perl_module-debug.so \
&& mv objs/ngx_stream_geoip_module.so objs/ngx_stream_geoip_module-debug.so \ # && mv objs/ngx_stream_geoip_module.so objs/ngx_stream_geoip_module-debug.so \
&& ./configure $CONFIG \ && ./configure $CONFIG \
&& make -j$(getconf _NPROCESSORS_ONLN) \ && make -j$(getconf _NPROCESSORS_ONLN) \
&& make install \ && make install \
@@ -131,14 +131,14 @@ RUN GPG_KEYS=B0F4253373F8F6F510D42178520A9993A1C052F8 \
&& install -m755 objs/nginx-debug /usr/sbin/nginx-debug \ && install -m755 objs/nginx-debug /usr/sbin/nginx-debug \
&& install -m755 objs/ngx_http_xslt_filter_module-debug.so /usr/lib/nginx/modules/ngx_http_xslt_filter_module-debug.so \ && install -m755 objs/ngx_http_xslt_filter_module-debug.so /usr/lib/nginx/modules/ngx_http_xslt_filter_module-debug.so \
&& install -m755 objs/ngx_http_image_filter_module-debug.so /usr/lib/nginx/modules/ngx_http_image_filter_module-debug.so \ && install -m755 objs/ngx_http_image_filter_module-debug.so /usr/lib/nginx/modules/ngx_http_image_filter_module-debug.so \
&& install -m755 objs/ngx_http_geoip_module-debug.so /usr/lib/nginx/modules/ngx_http_geoip_module-debug.so \ # && install -m755 objs/ngx_http_geoip_module-debug.so /usr/lib/nginx/modules/ngx_http_geoip_module-debug.so \
&& install -m755 objs/ngx_http_perl_module-debug.so /usr/lib/nginx/modules/ngx_http_perl_module-debug.so \ && install -m755 objs/ngx_http_perl_module-debug.so /usr/lib/nginx/modules/ngx_http_perl_module-debug.so \
&& install -m755 objs/ngx_stream_geoip_module-debug.so /usr/lib/nginx/modules/ngx_stream_geoip_module-debug.so \ # && install -m755 objs/ngx_stream_geoip_module-debug.so /usr/lib/nginx/modules/ngx_stream_geoip_module-debug.so \
&& ln -s ../../usr/lib/nginx/modules /etc/nginx/modules \ && ln -s ../../usr/lib/nginx/modules /etc/nginx/modules \
&& strip /usr/sbin/nginx* \ && strip /usr/sbin/nginx* \
&& strip /usr/lib/nginx/modules/*.so \ && strip /usr/lib/nginx/modules/*.so \
&& rm -rf /usr/src/nginx-$NGINX_VERSION \ && rm -rf /usr/src/nginx-$NGINX_VERSION \
&& rm -rf /usr/src/ngx_http_geoip2_module-$GEOIP2_MODULE_VERSION \ # && rm -rf /usr/src/ngx_http_geoip2_module-$GEOIP2_MODULE_VERSION \
\ \
# Bring in gettext so we can get `envsubst`, then throw # Bring in gettext so we can get `envsubst`, then throw
# the rest away. To do this, we need to install `gettext` # the rest away. To do this, we need to install `gettext`
@@ -200,14 +200,12 @@ RUN echo @testing http://nl.alpinelinux.org/alpine/edge/testing >> /etc/apk/repo
libjpeg-turbo-dev \ libjpeg-turbo-dev \
postgresql-dev && \ postgresql-dev && \
docker-php-ext-configure gd \ docker-php-ext-configure gd \
--with-gd \ --with-freetype \
--with-freetype-dir=/usr/include/ \ --with-jpeg && \
--with-png-dir=/usr/include/ \
--with-jpeg-dir=/usr/include/ && \
#curl iconv session #curl iconv session
#docker-php-ext-install pdo_mysql pdo_sqlite mysqli mcrypt gd exif intl xsl json soap dom zip opcache && \ #docker-php-ext-install pdo_mysql pdo_sqlite mysqli mcrypt gd exif intl xsl json soap dom zip opcache && \
docker-php-ext-install iconv pdo_mysql pdo_sqlite pgsql pdo_pgsql mysqli gd exif intl xsl json soap dom zip opcache && \ docker-php-ext-install iconv pdo_mysql pdo_sqlite pgsql pdo_pgsql mysqli gd exif intl xsl json soap dom zip opcache && \
pecl install xdebug-2.7.2 && \ pecl install xdebug-2.9.2 && \
pecl install -o -f redis && \ pecl install -o -f redis && \
echo "extension=redis.so" > /usr/local/etc/php/conf.d/redis.ini && \ echo "extension=redis.so" > /usr/local/etc/php/conf.d/redis.ini && \
docker-php-source delete && \ docker-php-source delete && \
@@ -241,11 +239,12 @@ ADD conf/nginx-site.conf /etc/nginx/sites-available/default.conf
ADD conf/nginx-site-ssl.conf /etc/nginx/sites-available/default-ssl.conf ADD conf/nginx-site-ssl.conf /etc/nginx/sites-available/default-ssl.conf
RUN ln -s /etc/nginx/sites-available/default.conf /etc/nginx/sites-enabled/default.conf RUN ln -s /etc/nginx/sites-available/default.conf /etc/nginx/sites-enabled/default.conf
## disabled due to license changes (to fix in next release)
# Add GeoLite2 databases (https://dev.maxmind.com/geoip/geoip2/geolite2/) # Add GeoLite2 databases (https://dev.maxmind.com/geoip/geoip2/geolite2/)
RUN curl -fSL http://geolite.maxmind.com/download/geoip/database/GeoLite2-City.mmdb.gz -o /etc/nginx/GeoLite2-City.mmdb.gz \ #RUN curl -fSL http://geolite.maxmind.com/download/geoip/database/GeoLite2-City.mmdb.gz -o /etc/nginx/GeoLite2-City.mmdb.gz \
&& curl -fSL http://geolite.maxmind.com/download/geoip/database/GeoLite2-Country.mmdb.gz -o /etc/nginx/GeoLite2-Country.mmdb.gz \ # && curl -fSL http://geolite.maxmind.com/download/geoip/database/GeoLite2-Country.mmdb.gz -o /etc/nginx/GeoLite2-Country.mmdb.gz \
&& gunzip /etc/nginx/GeoLite2-City.mmdb.gz \ # && gunzip /etc/nginx/GeoLite2-City.mmdb.gz \
&& gunzip /etc/nginx/GeoLite2-Country.mmdb.gz # && gunzip /etc/nginx/GeoLite2-Country.mmdb.gz
# tweak php-fpm config # tweak php-fpm config
RUN echo "cgi.fix_pathinfo=0" > ${php_vars} &&\ RUN echo "cgi.fix_pathinfo=0" > ${php_vars} &&\

View File

@@ -12,7 +12,7 @@ If you have improvements or suggestions please open an issue or pull request on
### Versioning ### Versioning
| Docker Tag | Git Release | Nginx Version | PHP Version | Alpine Version | | Docker Tag | Git Release | Nginx Version | PHP Version | Alpine Version |
|-----|-------|-----|--------|--------| |-----|-------|-----|--------|--------|
| latest/1.8.2 | Master Branch |1.16.1 | 7.3.9 | 3.10 | | latest/1.9.0 | Master Branch |1.16.1 | 7.4.2 | 3.11 |
For other tags please see: [versioning](https://gitlab.com/ric_harvey/nginx-php-fpm/blob/master/docs/versioning.md) For other tags please see: [versioning](https://gitlab.com/ric_harvey/nginx-php-fpm/blob/master/docs/versioning.md)

View File

@@ -63,16 +63,16 @@ server {
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param SCRIPT_NAME $fastcgi_script_name; fastcgi_param SCRIPT_NAME $fastcgi_script_name;
fastcgi_index index.php; fastcgi_index index.php;
fastcgi_param GEOIP2_LONGITUDE $geoip2_data_longitude; # fastcgi_param GEOIP2_LONGITUDE $geoip2_data_longitude;
fastcgi_param GEOIP2_LATITUDE $geoip2_data_latitude; # fastcgi_param GEOIP2_LATITUDE $geoip2_data_latitude;
fastcgi_param GEOIP2_CONTINENT_CODE $geoip2_data_continent_code; # fastcgi_param GEOIP2_CONTINENT_CODE $geoip2_data_continent_code;
fastcgi_param GEOIP2_CONTINENT_NAME $geoip2_data_continent_name; # fastcgi_param GEOIP2_CONTINENT_NAME $geoip2_data_continent_name;
fastcgi_param GEOIP2_COUNTRY_CODE $geoip2_data_country_code; # fastcgi_param GEOIP2_COUNTRY_CODE $geoip2_data_country_code;
fastcgi_param GEOIP2_COUNTRY_NAME $geoip2_data_country_name; # fastcgi_param GEOIP2_COUNTRY_NAME $geoip2_data_country_name;
fastcgi_param GEOIP2_STATE_CODE $geoip2_data_state_code; # fastcgi_param GEOIP2_STATE_CODE $geoip2_data_state_code;
fastcgi_param GEOIP2_STATE_NAME $geoip2_data_state_name; # fastcgi_param GEOIP2_STATE_NAME $geoip2_data_state_name;
fastcgi_param GEOIP2_CITY_NAME $geoip2_data_city_name; # fastcgi_param GEOIP2_CITY_NAME $geoip2_data_city_name;
fastcgi_param GEOIP2_POSTAL_CODE $geoip2_data_postal_code; # fastcgi_param GEOIP2_POSTAL_CODE $geoip2_data_postal_code;
include fastcgi_params; include fastcgi_params;
} }

View File

@@ -59,16 +59,16 @@ server {
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param SCRIPT_NAME $fastcgi_script_name; fastcgi_param SCRIPT_NAME $fastcgi_script_name;
fastcgi_index index.php; fastcgi_index index.php;
fastcgi_param GEOIP2_LONGITUDE $geoip2_data_longitude; # fastcgi_param GEOIP2_LONGITUDE $geoip2_data_longitude;
fastcgi_param GEOIP2_LATITUDE $geoip2_data_latitude; # fastcgi_param GEOIP2_LATITUDE $geoip2_data_latitude;
fastcgi_param GEOIP2_CONTINENT_CODE $geoip2_data_continent_code; # fastcgi_param GEOIP2_CONTINENT_CODE $geoip2_data_continent_code;
fastcgi_param GEOIP2_CONTINENT_NAME $geoip2_data_continent_name; # fastcgi_param GEOIP2_CONTINENT_NAME $geoip2_data_continent_name;
fastcgi_param GEOIP2_COUNTRY_CODE $geoip2_data_country_code; # fastcgi_param GEOIP2_COUNTRY_CODE $geoip2_data_country_code;
fastcgi_param GEOIP2_COUNTRY_NAME $geoip2_data_country_name; # fastcgi_param GEOIP2_COUNTRY_NAME $geoip2_data_country_name;
fastcgi_param GEOIP2_STATE_CODE $geoip2_data_state_code; # fastcgi_param GEOIP2_STATE_CODE $geoip2_data_state_code;
fastcgi_param GEOIP2_STATE_NAME $geoip2_data_state_name; # fastcgi_param GEOIP2_STATE_NAME $geoip2_data_state_name;
fastcgi_param GEOIP2_CITY_NAME $geoip2_data_city_name; # fastcgi_param GEOIP2_CITY_NAME $geoip2_data_city_name;
fastcgi_param GEOIP2_POSTAL_CODE $geoip2_data_postal_code; # fastcgi_param GEOIP2_POSTAL_CODE $geoip2_data_postal_code;
include fastcgi_params; include fastcgi_params;
} }

View File

@@ -33,37 +33,38 @@ http {
server_tokens off; server_tokens off;
#gzip on; #gzip on;
geoip2 /etc/nginx/GeoLite2-Country.mmdb { # Disabled due to license
auto_reload 1h; # geoip2 /etc/nginx/GeoLite2-Country.mmdb {
# auto_reload 1h;
$geoip2_metadata_country_build metadata build_epoch; #
# $geoip2_metadata_country_build metadata build_epoch;
# populate the country #
$geoip2_data_country_code source=$remote_addr country iso_code; # # populate the country
$geoip2_data_country_name source=$remote_addr country names en; # $geoip2_data_country_code source=$remote_addr country iso_code;
# $geoip2_data_country_name source=$remote_addr country names en;
# populate the continent #
$geoip2_data_continent_code source=$remote_addr continent code; # # populate the continent
$geoip2_data_continent_name source=$remote_addr continent names en; # $geoip2_data_continent_code source=$remote_addr continent code;
} # $geoip2_data_continent_name source=$remote_addr continent names en;
# }
geoip2 /etc/nginx/GeoLite2-City.mmdb { #
auto_reload 1h; # geoip2 /etc/nginx/GeoLite2-City.mmdb {
# auto_reload 1h;
# City name itself #
$geoip2_data_city_name source=$remote_addr city names en; # # City name itself
# $geoip2_data_city_name source=$remote_addr city names en;
# Postal code will be an approximation, probably the first one in the list that covers an area #
$geoip2_data_postal_code source=$remote_addr postal code; # # Postal code will be an approximation, probably the first one in the list that covers an area
# $geoip2_data_postal_code source=$remote_addr postal code;
# State in code and long form #
$geoip2_data_state_code source=$remote_addr subdivisions 0 iso_code; # # State in code and long form
$geoip2_data_state_name source=$remote_addr subdivisions 0 names en; # $geoip2_data_state_code source=$remote_addr subdivisions 0 iso_code;
# $geoip2_data_state_name source=$remote_addr subdivisions 0 names en;
# Lat and Lng #
$geoip2_data_latitude source=$remote_addr location latitude; # # Lat and Lng
$geoip2_data_longitude source=$remote_addr location longitude; # $geoip2_data_latitude source=$remote_addr location latitude;
} # $geoip2_data_longitude source=$remote_addr location longitude;
# }
include /etc/nginx/sites-enabled/*; include /etc/nginx/sites-enabled/*;
} }

View File

@@ -13,6 +13,16 @@ We will use the [semver](http://ricostacruz.com/cheatsheets/semver.html) style n
The latest tag will always follow the master branch in git. the other versions will have releases attached. The latest tag will always follow the master branch in git. the other versions will have releases attached.
#### PHP 7.4
| Docker Tag | PHP Version | Nginx Version | Alpine Version | Container Scripts | Notes |
|-----|-------|-----|--------|--------|----------|
| 1.9.0 | 7.4.2 |1.16.1 | 3.11 | 0.3.13 | upgrade to PHP 7.4.2 |
These tags will be created on GitLab and as tags in docker hub.
### Unmaintained tags:
#### PHP 7.3 #### PHP 7.3
| Docker Tag | PHP Version | Nginx Version | Alpine Version | Container Scripts | Notes | | Docker Tag | PHP Version | Nginx Version | Alpine Version | Container Scripts | Notes |
@@ -35,9 +45,6 @@ The latest tag will always follow the master branch in git. the other versions w
| 1.8.1 | 7.3.9 |1.16.1 | 3.10 | 0.3.12 | started python upgrade | | 1.8.1 | 7.3.9 |1.16.1 | 3.10 | 0.3.12 | started python upgrade |
| 1.8.2 | 7.3.9 |1.16.1 | 3.10 | 0.3.13 | geoip2, catchall and xdebug.remote merges | | 1.8.2 | 7.3.9 |1.16.1 | 3.10 | 0.3.13 | geoip2, catchall and xdebug.remote merges |
These tags will be created on GitLab and as tags in docker hub.
### Unmaintained tags:
#### PHP 7.2 #### PHP 7.2
| Docker Tag | PHP Version | Nginx Version | Alpine Version | Container Scripts | | Docker Tag | PHP Version | Nginx Version | Alpine Version | Container Scripts |