1
- FROM php:7.1.12 -fpm-alpine
1
+ FROM php:7.4.5 -fpm-alpine3.11
2
2
3
3
LABEL maintainer=
"Ric Harvey <[email protected] >"
4
4
5
5
ENV php_conf /usr/local/etc/php-fpm.conf
6
6
ENV fpm_conf /usr/local/etc/php-fpm.d/www.conf
7
7
ENV php_vars /usr/local/etc/php/conf.d/docker-vars.ini
8
8
9
- ENV NGINX_VERSION 1.13.7
10
- ENV LUA_MODULE_VERSION 0.10.11
9
+ ENV NGINX_VERSION 1.16.1
10
+ ENV LUA_MODULE_VERSION 0.10.14
11
11
ENV DEVEL_KIT_MODULE_VERSION 0.3.0
12
+ ENV GEOIP2_MODULE_VERSION 3.2
12
13
ENV LUAJIT_LIB=/usr/lib
13
- ENV LUAJIT_INC=/usr/include/luajit-2.0
14
+ ENV LUAJIT_INC=/usr/include/luajit-2.1
14
15
15
16
# resolves #166
16
17
ENV LD_PRELOAD /usr/lib/preloadable_libiconv.so php
17
- RUN apk add --no-cache --repository http://dl-3.alpinelinux.org/alpine/edge/testing gnu-libiconv
18
+ RUN apk add --no-cache --repository http://dl-3.alpinelinux.org/alpine/edge/community gnu-libiconv
18
19
19
20
RUN GPG_KEYS=B0F4253373F8F6F510D42178520A9993A1C052F8 \
20
21
&& CONFIG="\
@@ -48,14 +49,14 @@ RUN GPG_KEYS=B0F4253373F8F6F510D42178520A9993A1C052F8 \
48
49
--with-http_auth_request_module \
49
50
--with-http_xslt_module=dynamic \
50
51
--with-http_image_filter_module=dynamic \
51
- --with-http_geoip_module=dynamic \
52
+ # --with-http_geoip_module=dynamic \
52
53
--with-http_perl_module=dynamic \
53
54
--with-threads \
54
55
--with-stream \
55
56
--with-stream_ssl_module \
56
57
--with-stream_ssl_preread_module \
57
58
--with-stream_realip_module \
58
- --with-stream_geoip_module=dynamic \
59
+ # --with-stream_geoip_module=dynamic \
59
60
--with-http_slice_module \
60
61
--with-mail \
61
62
--with-mail_ssl_module \
@@ -64,6 +65,7 @@ RUN GPG_KEYS=B0F4253373F8F6F510D42178520A9993A1C052F8 \
64
65
--with-http_v2_module \
65
66
--add-module=/usr/src/ngx_devel_kit-$DEVEL_KIT_MODULE_VERSION \
66
67
--add-module=/usr/src/lua-nginx-module-$LUA_MODULE_VERSION \
68
+ # --add-module=/usr/src/ngx_http_geoip2_module-$GEOIP2_MODULE_VERSION \
67
69
" \
68
70
&& addgroup -S nginx \
69
71
&& adduser -D -S -h /var/cache/nginx -s /sbin/nologin -G nginx nginx \
@@ -72,21 +74,23 @@ RUN GPG_KEYS=B0F4253373F8F6F510D42178520A9993A1C052F8 \
72
74
gcc \
73
75
libc-dev \
74
76
make \
75
- openssl -dev \
77
+ libressl -dev \
76
78
pcre-dev \
77
79
zlib-dev \
78
80
linux-headers \
79
81
curl \
80
82
gnupg \
81
83
libxslt-dev \
82
84
gd-dev \
83
- geoip-dev \
85
+ # geoip-dev \
86
+ libmaxminddb-dev \
84
87
perl-dev \
85
88
luajit-dev \
86
89
&& curl -fSL http://nginx.org/download/nginx-$NGINX_VERSION.tar.gz -o nginx.tar.gz \
87
90
&& curl -fSL http://nginx.org/download/nginx-$NGINX_VERSION.tar.gz.asc -o nginx.tar.gz.asc \
88
91
&& curl -fSL https://github.com/simpl/ngx_devel_kit/archive/v$DEVEL_KIT_MODULE_VERSION.tar.gz -o ndk.tar.gz \
89
92
&& 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 \
90
94
&& export GNUPGHOME="$(mktemp -d)" \
91
95
&& found='' ; \
92
96
for server in \
@@ -100,21 +104,22 @@ RUN GPG_KEYS=B0F4253373F8F6F510D42178520A9993A1C052F8 \
100
104
done; \
101
105
test -z "$found" && echo >&2 "error: failed to fetch GPG key $GPG_KEYS" && exit 1; \
102
106
gpg --batch --verify nginx.tar.gz.asc nginx.tar.gz \
103
- && rm -r "$GNUPGHOME" nginx.tar.gz.asc \
107
+ # && rm -r "$GNUPGHOME" nginx.tar.gz.asc \
104
108
&& mkdir -p /usr/src \
105
109
&& tar -zxC /usr/src -f nginx.tar.gz \
106
110
&& tar -zxC /usr/src -f ndk.tar.gz \
107
111
&& 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 \
109
114
&& cd /usr/src/nginx-$NGINX_VERSION \
110
115
&& ./configure $CONFIG --with-debug \
111
116
&& make -j$(getconf _NPROCESSORS_ONLN) \
112
117
&& mv objs/nginx objs/nginx-debug \
113
118
&& mv objs/ngx_http_xslt_filter_module.so objs/ngx_http_xslt_filter_module-debug.so \
114
119
&& mv objs/ngx_http_image_filter_module.so objs/ngx_http_image_filter_module-debug.so \
115
- && 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 \
116
121
&& mv objs/ngx_http_perl_module.so objs/ngx_http_perl_module-debug.so \
117
- && 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 \
118
123
&& ./configure $CONFIG \
119
124
&& make -j$(getconf _NPROCESSORS_ONLN) \
120
125
&& make install \
@@ -126,13 +131,14 @@ RUN GPG_KEYS=B0F4253373F8F6F510D42178520A9993A1C052F8 \
126
131
&& install -m755 objs/nginx-debug /usr/sbin/nginx-debug \
127
132
&& install -m755 objs/ngx_http_xslt_filter_module-debug.so /usr/lib/nginx/modules/ngx_http_xslt_filter_module-debug.so \
128
133
&& install -m755 objs/ngx_http_image_filter_module-debug.so /usr/lib/nginx/modules/ngx_http_image_filter_module-debug.so \
129
- && 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 \
130
135
&& install -m755 objs/ngx_http_perl_module-debug.so /usr/lib/nginx/modules/ngx_http_perl_module-debug.so \
131
- && 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 \
132
137
&& ln -s ../../usr/lib/nginx/modules /etc/nginx/modules \
133
138
&& strip /usr/sbin/nginx* \
134
139
&& strip /usr/lib/nginx/modules/*.so \
135
140
&& rm -rf /usr/src/nginx-$NGINX_VERSION \
141
+ # && rm -rf /usr/src/ngx_http_geoip2_module-$GEOIP2_MODULE_VERSION \
136
142
\
137
143
# Bring in gettext so we can get `envsubst`, then throw
138
144
# the rest away. To do this, we need to install `gettext`
@@ -158,21 +164,24 @@ RUN GPG_KEYS=B0F4253373F8F6F510D42178520A9993A1C052F8 \
158
164
&& ln -sf /dev/stderr /var/log/nginx/error.log
159
165
160
166
RUN echo @testing http://nl.alpinelinux.org/alpine/edge/testing >> /etc/apk/repositories && \
161
- # sed -i -e "s/v3.4/edge/" /etc/apk/repositories && \
162
167
echo /etc/apk/respositories && \
163
- apk update && \
164
- apk add --no-cache bash \
168
+ apk update && apk upgrade &&\
169
+ apk add --no-cache \
170
+ bash \
165
171
openssh-client \
166
172
wget \
167
173
supervisor \
168
174
curl \
169
175
libcurl \
176
+ libzip-dev \
177
+ bzip2-dev \
178
+ imap-dev \
179
+ openssl-dev \
170
180
git \
171
- python \
172
- python-dev \
173
- py-pip \
181
+ python3 \
182
+ python3-dev \
174
183
augeas-dev \
175
- openssl -dev \
184
+ libressl -dev \
176
185
ca-certificates \
177
186
dialog \
178
187
autoconf \
@@ -188,29 +197,30 @@ RUN echo @testing http://nl.alpinelinux.org/alpine/edge/testing >> /etc/apk/repo
188
197
libffi-dev \
189
198
freetype-dev \
190
199
sqlite-dev \
191
- libjpeg-turbo-dev && \
200
+ libjpeg-turbo-dev \
201
+ postgresql-dev && \
192
202
docker-php-ext-configure gd \
193
- --with-gd \
194
- --with-freetype-dir=/usr/include/ \
195
- --with-png-dir=/usr/include/ \
196
- --with-jpeg-dir=/usr/include/ && \
203
+ --with-freetype \
204
+ --with-jpeg && \
197
205
# curl iconv session
198
- docker-php-ext-install pdo_mysql pdo_sqlite mysqli mcrypt gd exif intl xsl json soap dom zip opcache && \
199
- pecl install xdebug && \
206
+ # docker-php-ext-install pdo_mysql pdo_sqlite mysqli mcrypt gd exif intl xsl json soap dom zip opcache && \
207
+ docker-php-ext-install iconv pdo_mysql pdo_sqlite pgsql pdo_pgsql mysqli gd exif intl xsl json soap dom zip opcache && \
208
+ pecl install xdebug-2.9.2 && \
209
+ pecl install -o -f redis && \
210
+ echo "extension=redis.so" > /usr/local/etc/php/conf.d/redis.ini && \
200
211
docker-php-source delete && \
201
212
mkdir -p /etc/nginx && \
202
213
mkdir -p /var/www/app && \
203
214
mkdir -p /run/nginx && \
204
215
mkdir -p /var/log/supervisor && \
205
- EXPECTED_COMPOSER_SIGNATURE=$(wget -q -O - https://composer.github.io/installer.sig) && \
206
216
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" && \
207
- php -r "if (hash_file('SHA384', 'composer-setup.php') === '${EXPECTED_COMPOSER_SIGNATURE}') { echo 'Composer.phar Installer verified'; } else { echo 'Composer.phar Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;" && \
208
- php composer-setup.php --install-dir=/usr/bin --filename=composer && \
209
- php -r "unlink('composer-setup.php');" && \
210
- pip install -U pip && \
211
- pip install -U certbot && \
217
+ php composer-setup.php --quiet --install-dir=/usr/bin --filename=composer && \
218
+ rm composer-setup.php && \
219
+ pip3 install -U pip && \
220
+ pip3 install -U certbot && \
212
221
mkdir -p /etc/letsencrypt/webrootauth && \
213
- apk del gcc musl-dev linux-headers libffi-dev augeas-dev python-dev make autoconf
222
+ apk del gcc musl-dev linux-headers libffi-dev augeas-dev python3-dev make autoconf
223
+ # apk del .sys-deps
214
224
# ln -s /usr/bin/php7 /usr/bin/php
215
225
216
226
ADD conf/supervisord.conf /etc/supervisord.conf
@@ -229,6 +239,13 @@ ADD conf/nginx-site.conf /etc/nginx/sites-available/default.conf
229
239
ADD conf/nginx-site-ssl.conf /etc/nginx/sites-available/default-ssl.conf
230
240
RUN ln -s /etc/nginx/sites-available/default.conf /etc/nginx/sites-enabled/default.conf
231
241
242
+ # # disabled due to license changes (to fix in next release)
243
+ # Add GeoLite2 databases (https://dev.maxmind.com/geoip/geoip2/geolite2/)
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
248
+
232
249
# tweak php-fpm config
233
250
RUN echo "cgi.fix_pathinfo=0" > ${php_vars} &&\
234
251
echo "upload_max_filesize = 100M" >> ${php_vars} &&\
@@ -269,4 +286,5 @@ ADD errors/ /var/www/errors
269
286
270
287
EXPOSE 443 80
271
288
289
+ WORKDIR "/var/www/html"
272
290
CMD ["/start.sh" ]
0 commit comments