Skip to content

Commit 5f7fcc2

Browse files
author
ric
committed
updated to php 7.4.2 but geoip is broken - to fix
1 parent 218147f commit 5f7fcc2

File tree

6 files changed

+84
-77
lines changed

6 files changed

+84
-77
lines changed

Dockerfile

Lines changed: 21 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM php:7.3.9-fpm-alpine3.10
1+
FROM php:7.4.2-fpm-alpine3.11
22

33
LABEL maintainer="Ric Harvey <ric@ngd.io>"
44

@@ -49,14 +49,14 @@ RUN GPG_KEYS=B0F4253373F8F6F510D42178520A9993A1C052F8 \
4949
--with-http_auth_request_module \
5050
--with-http_xslt_module=dynamic \
5151
--with-http_image_filter_module=dynamic \
52-
--with-http_geoip_module=dynamic \
52+
# --with-http_geoip_module=dynamic \
5353
--with-http_perl_module=dynamic \
5454
--with-threads \
5555
--with-stream \
5656
--with-stream_ssl_module \
5757
--with-stream_ssl_preread_module \
5858
--with-stream_realip_module \
59-
--with-stream_geoip_module=dynamic \
59+
# --with-stream_geoip_module=dynamic \
6060
--with-http_slice_module \
6161
--with-mail \
6262
--with-mail_ssl_module \
@@ -65,7 +65,7 @@ RUN GPG_KEYS=B0F4253373F8F6F510D42178520A9993A1C052F8 \
6565
--with-http_v2_module \
6666
--add-module=/usr/src/ngx_devel_kit-$DEVEL_KIT_MODULE_VERSION \
6767
--add-module=/usr/src/lua-nginx-module-$LUA_MODULE_VERSION \
68-
--add-module=/usr/src/ngx_http_geoip2_module-$GEOIP2_MODULE_VERSION \
68+
# --add-module=/usr/src/ngx_http_geoip2_module-$GEOIP2_MODULE_VERSION \
6969
" \
7070
&& addgroup -S nginx \
7171
&& adduser -D -S -h /var/cache/nginx -s /sbin/nologin -G nginx nginx \
@@ -82,15 +82,15 @@ RUN GPG_KEYS=B0F4253373F8F6F510D42178520A9993A1C052F8 \
8282
gnupg \
8383
libxslt-dev \
8484
gd-dev \
85-
geoip-dev \
85+
# geoip-dev \
8686
libmaxminddb-dev \
8787
perl-dev \
8888
luajit-dev \
8989
&& curl -fSL http://nginx.org/download/nginx-$NGINX_VERSION.tar.gz -o nginx.tar.gz \
9090
&& curl -fSL http://nginx.org/download/nginx-$NGINX_VERSION.tar.gz.asc -o nginx.tar.gz.asc \
9191
&& curl -fSL https://github.com/simpl/ngx_devel_kit/archive/v$DEVEL_KIT_MODULE_VERSION.tar.gz -o ndk.tar.gz \
9292
&& 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 \
93+
# && curl -fSL https://github.com/leev/ngx_http_geoip2_module/archive/$GEOIP2_MODULE_VERSION.tar.gz -o ngx_http_geoip2_module.tar.gz \
9494
&& export GNUPGHOME="$(mktemp -d)" \
9595
&& found=''; \
9696
for server in \
@@ -109,17 +109,17 @@ RUN GPG_KEYS=B0F4253373F8F6F510D42178520A9993A1C052F8 \
109109
&& tar -zxC /usr/src -f nginx.tar.gz \
110110
&& tar -zxC /usr/src -f ndk.tar.gz \
111111
&& tar -zxC /usr/src -f 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 \
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 \
114114
&& cd /usr/src/nginx-$NGINX_VERSION \
115115
&& ./configure $CONFIG --with-debug \
116116
&& make -j$(getconf _NPROCESSORS_ONLN) \
117117
&& mv objs/nginx objs/nginx-debug \
118118
&& mv objs/ngx_http_xslt_filter_module.so objs/ngx_http_xslt_filter_module-debug.so \
119119
&& mv objs/ngx_http_image_filter_module.so objs/ngx_http_image_filter_module-debug.so \
120-
&& mv objs/ngx_http_geoip_module.so objs/ngx_http_geoip_module-debug.so \
120+
# && mv objs/ngx_http_geoip_module.so objs/ngx_http_geoip_module-debug.so \
121121
&& mv objs/ngx_http_perl_module.so objs/ngx_http_perl_module-debug.so \
122-
&& mv objs/ngx_stream_geoip_module.so objs/ngx_stream_geoip_module-debug.so \
122+
# && mv objs/ngx_stream_geoip_module.so objs/ngx_stream_geoip_module-debug.so \
123123
&& ./configure $CONFIG \
124124
&& make -j$(getconf _NPROCESSORS_ONLN) \
125125
&& make install \
@@ -131,14 +131,14 @@ RUN GPG_KEYS=B0F4253373F8F6F510D42178520A9993A1C052F8 \
131131
&& install -m755 objs/nginx-debug /usr/sbin/nginx-debug \
132132
&& install -m755 objs/ngx_http_xslt_filter_module-debug.so /usr/lib/nginx/modules/ngx_http_xslt_filter_module-debug.so \
133133
&& install -m755 objs/ngx_http_image_filter_module-debug.so /usr/lib/nginx/modules/ngx_http_image_filter_module-debug.so \
134-
&& install -m755 objs/ngx_http_geoip_module-debug.so /usr/lib/nginx/modules/ngx_http_geoip_module-debug.so \
134+
# && install -m755 objs/ngx_http_geoip_module-debug.so /usr/lib/nginx/modules/ngx_http_geoip_module-debug.so \
135135
&& install -m755 objs/ngx_http_perl_module-debug.so /usr/lib/nginx/modules/ngx_http_perl_module-debug.so \
136-
&& install -m755 objs/ngx_stream_geoip_module-debug.so /usr/lib/nginx/modules/ngx_stream_geoip_module-debug.so \
136+
# && install -m755 objs/ngx_stream_geoip_module-debug.so /usr/lib/nginx/modules/ngx_stream_geoip_module-debug.so \
137137
&& ln -s ../../usr/lib/nginx/modules /etc/nginx/modules \
138138
&& strip /usr/sbin/nginx* \
139139
&& strip /usr/lib/nginx/modules/*.so \
140140
&& rm -rf /usr/src/nginx-$NGINX_VERSION \
141-
&& rm -rf /usr/src/ngx_http_geoip2_module-$GEOIP2_MODULE_VERSION \
141+
# && rm -rf /usr/src/ngx_http_geoip2_module-$GEOIP2_MODULE_VERSION \
142142
\
143143
# Bring in gettext so we can get `envsubst`, then throw
144144
# 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
200200
libjpeg-turbo-dev \
201201
postgresql-dev && \
202202
docker-php-ext-configure gd \
203-
--with-gd \
204-
--with-freetype-dir=/usr/include/ \
205-
--with-png-dir=/usr/include/ \
206-
--with-jpeg-dir=/usr/include/ && \
203+
--with-freetype \
204+
--with-jpeg && \
207205
#curl iconv session
208206
#docker-php-ext-install pdo_mysql pdo_sqlite mysqli mcrypt gd exif intl xsl json soap dom zip opcache && \
209207
docker-php-ext-install iconv pdo_mysql pdo_sqlite pgsql pdo_pgsql mysqli gd exif intl xsl json soap dom zip opcache && \
210-
pecl install xdebug-2.7.2 && \
208+
pecl install xdebug-2.9.2 && \
211209
pecl install -o -f redis && \
212210
echo "extension=redis.so" > /usr/local/etc/php/conf.d/redis.ini && \
213211
docker-php-source delete && \
@@ -241,11 +239,12 @@ ADD conf/nginx-site.conf /etc/nginx/sites-available/default.conf
241239
ADD conf/nginx-site-ssl.conf /etc/nginx/sites-available/default-ssl.conf
242240
RUN ln -s /etc/nginx/sites-available/default.conf /etc/nginx/sites-enabled/default.conf
243241

242+
## disabled due to license changes (to fix in next release)
244243
# Add GeoLite2 databases (https://dev.maxmind.com/geoip/geoip2/geolite2/)
245-
RUN curl -fSL http://geolite.maxmind.com/download/geoip/database/GeoLite2-City.mmdb.gz -o /etc/nginx/GeoLite2-City.mmdb.gz \
246-
&& curl -fSL http://geolite.maxmind.com/download/geoip/database/GeoLite2-Country.mmdb.gz -o /etc/nginx/GeoLite2-Country.mmdb.gz \
247-
&& gunzip /etc/nginx/GeoLite2-City.mmdb.gz \
248-
&& gunzip /etc/nginx/GeoLite2-Country.mmdb.gz
244+
#RUN curl -fSL http://geolite.maxmind.com/download/geoip/database/GeoLite2-City.mmdb.gz -o /etc/nginx/GeoLite2-City.mmdb.gz \
245+
# && curl -fSL http://geolite.maxmind.com/download/geoip/database/GeoLite2-Country.mmdb.gz -o /etc/nginx/GeoLite2-Country.mmdb.gz \
246+
# && gunzip /etc/nginx/GeoLite2-City.mmdb.gz \
247+
# && gunzip /etc/nginx/GeoLite2-Country.mmdb.gz
249248

250249
# tweak php-fpm config
251250
RUN echo "cgi.fix_pathinfo=0" > ${php_vars} &&\

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ If you have improvements or suggestions please open an issue or pull request on
1212
### Versioning
1313
| Docker Tag | Git Release | Nginx Version | PHP Version | Alpine Version |
1414
|-----|-------|-----|--------|--------|
15-
| latest/1.8.2 | Master Branch |1.16.1 | 7.3.9 | 3.10 |
15+
| latest/1.9.0 | Master Branch |1.16.1 | 7.4.2 | 3.11 |
1616

1717
For other tags please see: [versioning](https://gitlab.com/ric_harvey/nginx-php-fpm/blob/master/docs/versioning.md)
1818

conf/nginx-site-ssl.conf

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -63,16 +63,16 @@ server {
6363
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
6464
fastcgi_param SCRIPT_NAME $fastcgi_script_name;
6565
fastcgi_index index.php;
66-
fastcgi_param GEOIP2_LONGITUDE $geoip2_data_longitude;
67-
fastcgi_param GEOIP2_LATITUDE $geoip2_data_latitude;
68-
fastcgi_param GEOIP2_CONTINENT_CODE $geoip2_data_continent_code;
69-
fastcgi_param GEOIP2_CONTINENT_NAME $geoip2_data_continent_name;
70-
fastcgi_param GEOIP2_COUNTRY_CODE $geoip2_data_country_code;
71-
fastcgi_param GEOIP2_COUNTRY_NAME $geoip2_data_country_name;
72-
fastcgi_param GEOIP2_STATE_CODE $geoip2_data_state_code;
73-
fastcgi_param GEOIP2_STATE_NAME $geoip2_data_state_name;
74-
fastcgi_param GEOIP2_CITY_NAME $geoip2_data_city_name;
75-
fastcgi_param GEOIP2_POSTAL_CODE $geoip2_data_postal_code;
66+
# fastcgi_param GEOIP2_LONGITUDE $geoip2_data_longitude;
67+
# fastcgi_param GEOIP2_LATITUDE $geoip2_data_latitude;
68+
# fastcgi_param GEOIP2_CONTINENT_CODE $geoip2_data_continent_code;
69+
# fastcgi_param GEOIP2_CONTINENT_NAME $geoip2_data_continent_name;
70+
# fastcgi_param GEOIP2_COUNTRY_CODE $geoip2_data_country_code;
71+
# fastcgi_param GEOIP2_COUNTRY_NAME $geoip2_data_country_name;
72+
# fastcgi_param GEOIP2_STATE_CODE $geoip2_data_state_code;
73+
# fastcgi_param GEOIP2_STATE_NAME $geoip2_data_state_name;
74+
# fastcgi_param GEOIP2_CITY_NAME $geoip2_data_city_name;
75+
# fastcgi_param GEOIP2_POSTAL_CODE $geoip2_data_postal_code;
7676
include fastcgi_params;
7777
}
7878

conf/nginx-site.conf

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -59,16 +59,16 @@ server {
5959
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
6060
fastcgi_param SCRIPT_NAME $fastcgi_script_name;
6161
fastcgi_index index.php;
62-
fastcgi_param GEOIP2_LONGITUDE $geoip2_data_longitude;
63-
fastcgi_param GEOIP2_LATITUDE $geoip2_data_latitude;
64-
fastcgi_param GEOIP2_CONTINENT_CODE $geoip2_data_continent_code;
65-
fastcgi_param GEOIP2_CONTINENT_NAME $geoip2_data_continent_name;
66-
fastcgi_param GEOIP2_COUNTRY_CODE $geoip2_data_country_code;
67-
fastcgi_param GEOIP2_COUNTRY_NAME $geoip2_data_country_name;
68-
fastcgi_param GEOIP2_STATE_CODE $geoip2_data_state_code;
69-
fastcgi_param GEOIP2_STATE_NAME $geoip2_data_state_name;
70-
fastcgi_param GEOIP2_CITY_NAME $geoip2_data_city_name;
71-
fastcgi_param GEOIP2_POSTAL_CODE $geoip2_data_postal_code;
62+
# fastcgi_param GEOIP2_LONGITUDE $geoip2_data_longitude;
63+
# fastcgi_param GEOIP2_LATITUDE $geoip2_data_latitude;
64+
# fastcgi_param GEOIP2_CONTINENT_CODE $geoip2_data_continent_code;
65+
# fastcgi_param GEOIP2_CONTINENT_NAME $geoip2_data_continent_name;
66+
# fastcgi_param GEOIP2_COUNTRY_CODE $geoip2_data_country_code;
67+
# fastcgi_param GEOIP2_COUNTRY_NAME $geoip2_data_country_name;
68+
# fastcgi_param GEOIP2_STATE_CODE $geoip2_data_state_code;
69+
# fastcgi_param GEOIP2_STATE_NAME $geoip2_data_state_name;
70+
# fastcgi_param GEOIP2_CITY_NAME $geoip2_data_city_name;
71+
# fastcgi_param GEOIP2_POSTAL_CODE $geoip2_data_postal_code;
7272
include fastcgi_params;
7373
}
7474

conf/nginx.conf

Lines changed: 32 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -33,37 +33,38 @@ http {
3333
server_tokens off;
3434
#gzip on;
3535

36-
geoip2 /etc/nginx/GeoLite2-Country.mmdb {
37-
auto_reload 1h;
38-
39-
$geoip2_metadata_country_build metadata build_epoch;
40-
41-
# populate the country
42-
$geoip2_data_country_code source=$remote_addr country iso_code;
43-
$geoip2_data_country_name source=$remote_addr country names en;
44-
45-
# populate the continent
46-
$geoip2_data_continent_code source=$remote_addr continent code;
47-
$geoip2_data_continent_name source=$remote_addr continent names en;
48-
}
49-
50-
geoip2 /etc/nginx/GeoLite2-City.mmdb {
51-
auto_reload 1h;
52-
53-
# City name itself
54-
$geoip2_data_city_name source=$remote_addr city names en;
55-
56-
# Postal code will be an approximation, probably the first one in the list that covers an area
57-
$geoip2_data_postal_code source=$remote_addr postal code;
58-
59-
# State in code and long form
60-
$geoip2_data_state_code source=$remote_addr subdivisions 0 iso_code;
61-
$geoip2_data_state_name source=$remote_addr subdivisions 0 names en;
62-
63-
# Lat and Lng
64-
$geoip2_data_latitude source=$remote_addr location latitude;
65-
$geoip2_data_longitude source=$remote_addr location longitude;
66-
}
36+
# Disabled due to license
37+
# geoip2 /etc/nginx/GeoLite2-Country.mmdb {
38+
# auto_reload 1h;
39+
#
40+
# $geoip2_metadata_country_build metadata build_epoch;
41+
#
42+
# # populate the country
43+
# $geoip2_data_country_code source=$remote_addr country iso_code;
44+
# $geoip2_data_country_name source=$remote_addr country names en;
45+
#
46+
# # populate the continent
47+
# $geoip2_data_continent_code source=$remote_addr continent code;
48+
# $geoip2_data_continent_name source=$remote_addr continent names en;
49+
# }
50+
#
51+
# geoip2 /etc/nginx/GeoLite2-City.mmdb {
52+
# auto_reload 1h;
53+
#
54+
# # City name itself
55+
# $geoip2_data_city_name source=$remote_addr city names en;
56+
#
57+
# # Postal code will be an approximation, probably the first one in the list that covers an area
58+
# $geoip2_data_postal_code source=$remote_addr postal code;
59+
#
60+
# # State in code and long form
61+
# $geoip2_data_state_code source=$remote_addr subdivisions 0 iso_code;
62+
# $geoip2_data_state_name source=$remote_addr subdivisions 0 names en;
63+
#
64+
# # Lat and Lng
65+
# $geoip2_data_latitude source=$remote_addr location latitude;
66+
# $geoip2_data_longitude source=$remote_addr location longitude;
67+
# }
6768

6869
include /etc/nginx/sites-enabled/*;
6970
}

docs/versioning.md

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,16 @@ We will use the [semver](http://ricostacruz.com/cheatsheets/semver.html) style n
1313

1414
The latest tag will always follow the master branch in git. the other versions will have releases attached.
1515

16+
#### PHP 7.4
17+
18+
| Docker Tag | PHP Version | Nginx Version | Alpine Version | Container Scripts | Notes |
19+
|-----|-------|-----|--------|--------|----------|
20+
| 1.9.0 | 7.4.2 |1.16.1 | 3.11 | 0.3.13 | upgrade to PHP 7.4.2 |
21+
22+
These tags will be created on GitLab and as tags in docker hub.
23+
24+
### Unmaintained tags:
25+
1626
#### PHP 7.3
1727

1828
| 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
3545
| 1.8.1 | 7.3.9 |1.16.1 | 3.10 | 0.3.12 | started python upgrade |
3646
| 1.8.2 | 7.3.9 |1.16.1 | 3.10 | 0.3.13 | geoip2, catchall and xdebug.remote merges |
3747

38-
These tags will be created on GitLab and as tags in docker hub.
39-
40-
### Unmaintained tags:
4148
#### PHP 7.2
4249

4350
| Docker Tag | PHP Version | Nginx Version | Alpine Version | Container Scripts |

0 commit comments

Comments
 (0)