Skip to content

Commit 8f00dea

Browse files
authored
Merge pull request #3 from richarvey/master
Latest upstream changes
2 parents 03b7770 + 50afaef commit 8f00dea

28 files changed

+310
-632
lines changed

.github/FUNDING.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
patreon: richarvey

.gitlab-ci.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
image: docker:latest
2+
services:
3+
- docker:dind
4+
5+
stages:
6+
- build_latest
7+
- build_tags
8+
9+
before_script:
10+
- echo Logging in to $CI_REGISTRY...
11+
- docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD"
12+
- docker info | grep Registry
13+
14+
build_latest:
15+
stage: build_latest
16+
script:
17+
- echo Build started on `date` for $CI_COMMIT_REF_NAME
18+
- docker build -t richarvey/nginx-php-fpm:latest .
19+
- docker images
20+
- docker push "$CI_REGISTRY_IMAGE":latest
21+
only:
22+
- master
23+
24+
build_tags:
25+
stage: build_tags
26+
script:
27+
- echo Build started on `date` for $CI_COMMIT_REF_NAME
28+
- docker build -t richarvey/nginx-php-fpm:"$CI_COMMIT_REF_NAME" .
29+
- docker images
30+
- docker push "$CI_REGISTRY_IMAGE":"$CI_COMMIT_REF_NAME"
31+
only:
32+
- tags

.travis.yml

Lines changed: 0 additions & 22 deletions
This file was deleted.

.travis/requirements.txt

Lines changed: 0 additions & 1 deletion
This file was deleted.

.travis/tests.py

Lines changed: 0 additions & 22 deletions
This file was deleted.

.travis/tests/functional/test_content.py

Lines changed: 0 additions & 62 deletions
This file was deleted.

Dockerfile

Lines changed: 54 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,21 @@
1-
FROM php:7.1.12-fpm-alpine
1+
FROM php:7.4.5-fpm-alpine3.11
22

33
LABEL maintainer="Ric Harvey <[email protected]>"
44

55
ENV php_conf /usr/local/etc/php-fpm.conf
66
ENV fpm_conf /usr/local/etc/php-fpm.d/www.conf
77
ENV php_vars /usr/local/etc/php/conf.d/docker-vars.ini
88

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
1111
ENV DEVEL_KIT_MODULE_VERSION 0.3.0
12+
ENV GEOIP2_MODULE_VERSION 3.2
1213
ENV LUAJIT_LIB=/usr/lib
13-
ENV LUAJIT_INC=/usr/include/luajit-2.0
14+
ENV LUAJIT_INC=/usr/include/luajit-2.1
1415

1516
# resolves #166
1617
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
1819

1920
RUN GPG_KEYS=B0F4253373F8F6F510D42178520A9993A1C052F8 \
2021
&& CONFIG="\
@@ -48,14 +49,14 @@ RUN GPG_KEYS=B0F4253373F8F6F510D42178520A9993A1C052F8 \
4849
--with-http_auth_request_module \
4950
--with-http_xslt_module=dynamic \
5051
--with-http_image_filter_module=dynamic \
51-
--with-http_geoip_module=dynamic \
52+
# --with-http_geoip_module=dynamic \
5253
--with-http_perl_module=dynamic \
5354
--with-threads \
5455
--with-stream \
5556
--with-stream_ssl_module \
5657
--with-stream_ssl_preread_module \
5758
--with-stream_realip_module \
58-
--with-stream_geoip_module=dynamic \
59+
# --with-stream_geoip_module=dynamic \
5960
--with-http_slice_module \
6061
--with-mail \
6162
--with-mail_ssl_module \
@@ -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 \
@@ -72,21 +74,23 @@ RUN GPG_KEYS=B0F4253373F8F6F510D42178520A9993A1C052F8 \
7274
gcc \
7375
libc-dev \
7476
make \
75-
openssl-dev \
77+
libressl-dev \
7678
pcre-dev \
7779
zlib-dev \
7880
linux-headers \
7981
curl \
8082
gnupg \
8183
libxslt-dev \
8284
gd-dev \
83-
geoip-dev \
85+
# 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 \
@@ -100,21 +104,22 @@ RUN GPG_KEYS=B0F4253373F8F6F510D42178520A9993A1C052F8 \
100104
done; \
101105
test -z "$found" && echo >&2 "error: failed to fetch GPG key $GPG_KEYS" && exit 1; \
102106
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 \
104108
&& mkdir -p /usr/src \
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) \
112117
&& mv objs/nginx objs/nginx-debug \
113118
&& mv objs/ngx_http_xslt_filter_module.so objs/ngx_http_xslt_filter_module-debug.so \
114119
&& 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 \
116121
&& 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 \
118123
&& ./configure $CONFIG \
119124
&& make -j$(getconf _NPROCESSORS_ONLN) \
120125
&& make install \
@@ -126,13 +131,14 @@ RUN GPG_KEYS=B0F4253373F8F6F510D42178520A9993A1C052F8 \
126131
&& install -m755 objs/nginx-debug /usr/sbin/nginx-debug \
127132
&& install -m755 objs/ngx_http_xslt_filter_module-debug.so /usr/lib/nginx/modules/ngx_http_xslt_filter_module-debug.so \
128133
&& 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 \
130135
&& 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 \
132137
&& ln -s ../../usr/lib/nginx/modules /etc/nginx/modules \
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`
@@ -158,21 +164,24 @@ RUN GPG_KEYS=B0F4253373F8F6F510D42178520A9993A1C052F8 \
158164
&& ln -sf /dev/stderr /var/log/nginx/error.log
159165

160166
RUN echo @testing http://nl.alpinelinux.org/alpine/edge/testing >> /etc/apk/repositories && \
161-
# sed -i -e "s/v3.4/edge/" /etc/apk/repositories && \
162167
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 \
165171
openssh-client \
166172
wget \
167173
supervisor \
168174
curl \
169175
libcurl \
176+
libzip-dev \
177+
bzip2-dev \
178+
imap-dev \
179+
openssl-dev \
170180
git \
171-
python \
172-
python-dev \
173-
py-pip \
181+
python3 \
182+
python3-dev \
174183
augeas-dev \
175-
openssl-dev \
184+
libressl-dev \
176185
ca-certificates \
177186
dialog \
178187
autoconf \
@@ -188,29 +197,30 @@ RUN echo @testing http://nl.alpinelinux.org/alpine/edge/testing >> /etc/apk/repo
188197
libffi-dev \
189198
freetype-dev \
190199
sqlite-dev \
191-
libjpeg-turbo-dev && \
200+
libjpeg-turbo-dev \
201+
postgresql-dev && \
192202
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 && \
197205
#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 && \
200211
docker-php-source delete && \
201212
mkdir -p /etc/nginx && \
202213
mkdir -p /var/www/app && \
203214
mkdir -p /run/nginx && \
204215
mkdir -p /var/log/supervisor && \
205-
EXPECTED_COMPOSER_SIGNATURE=$(wget -q -O - https://composer.github.io/installer.sig) && \
206216
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 && \
212221
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
214224
# ln -s /usr/bin/php7 /usr/bin/php
215225

216226
ADD conf/supervisord.conf /etc/supervisord.conf
@@ -229,6 +239,13 @@ ADD conf/nginx-site.conf /etc/nginx/sites-available/default.conf
229239
ADD conf/nginx-site-ssl.conf /etc/nginx/sites-available/default-ssl.conf
230240
RUN ln -s /etc/nginx/sites-available/default.conf /etc/nginx/sites-enabled/default.conf
231241

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+
232249
# tweak php-fpm config
233250
RUN echo "cgi.fix_pathinfo=0" > ${php_vars} &&\
234251
echo "upload_max_filesize = 100M" >> ${php_vars} &&\
@@ -269,4 +286,5 @@ ADD errors/ /var/www/errors
269286

270287
EXPOSE 443 80
271288

289+
WORKDIR "/var/www/html"
272290
CMD ["/start.sh"]

0 commit comments

Comments
 (0)