From 9c9562948afeef90eba3025a45368aee7931e416 Mon Sep 17 00:00:00 2001 From: Ric Harvey Date: Wed, 1 Mar 2023 00:16:14 +0000 Subject: [PATCH] Upgrade to php 8.2.3 --- Dockerfile | 186 ++++++--------------------------------------- README.md | 2 +- docs/versioning.md | 10 ++- 3 files changed, 31 insertions(+), 167 deletions(-) diff --git a/Dockerfile b/Dockerfile index 104c9575..8a0caadc 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM php:8.1.12-fpm-alpine3.16 +FROM php:8.2.3-fpm-alpine3.17 LABEL maintainer="Ric Harvey " @@ -6,9 +6,6 @@ ENV php_conf /usr/local/etc/php-fpm.conf ENV fpm_conf /usr/local/etc/php-fpm.d/www.conf ENV php_vars /usr/local/etc/php/conf.d/docker-vars.ini -ENV NGINX_VERSION 1.22.1 -ENV LUA_MODULE_VERSION 0.10.22 -ENV DEVEL_KIT_MODULE_VERSION 0.3.1 ENV LUAJIT_LIB=/usr/lib ENV LUAJIT_INC=/usr/include/luajit-2.1 @@ -16,150 +13,11 @@ ENV LUAJIT_INC=/usr/include/luajit-2.1 ENV LD_PRELOAD /usr/lib/preloadable_libiconv.so php RUN apk add --no-cache --repository http://dl-3.alpinelinux.org/alpine/edge/community gnu-libiconv -RUN GPG_KEYS=573BFD6B3D8FBC641079A6ABABF5BD827BD9BF62 \ - && CONFIG="\ - --prefix=/etc/nginx \ - --sbin-path=/usr/sbin/nginx \ - --modules-path=/usr/lib/nginx/modules \ - --conf-path=/etc/nginx/nginx.conf \ - --error-log-path=/var/log/nginx/error.log \ - --http-log-path=/var/log/nginx/access.log \ - --pid-path=/var/run/nginx.pid \ - --lock-path=/var/run/nginx.lock \ - --http-client-body-temp-path=/var/cache/nginx/client_temp \ - --http-proxy-temp-path=/var/cache/nginx/proxy_temp \ - --http-fastcgi-temp-path=/var/cache/nginx/fastcgi_temp \ - --http-uwsgi-temp-path=/var/cache/nginx/uwsgi_temp \ - --http-scgi-temp-path=/var/cache/nginx/scgi_temp \ - --user=nginx \ - --group=nginx \ - --with-http_ssl_module \ - --with-http_realip_module \ - --with-http_addition_module \ - --with-http_sub_module \ - --with-http_dav_module \ - --with-http_flv_module \ - --with-http_mp4_module \ - --with-http_gunzip_module \ - --with-http_gzip_static_module \ - --with-http_random_index_module \ - --with-http_secure_link_module \ - --with-http_stub_status_module \ - --with-http_auth_request_module \ - --with-http_xslt_module=dynamic \ - --with-http_image_filter_module=dynamic \ -# --with-http_geoip_module=dynamic \ - --with-http_perl_module=dynamic \ - --with-threads \ - --with-stream \ - --with-stream_ssl_module \ - --with-stream_ssl_preread_module \ - --with-stream_realip_module \ -# --with-stream_geoip_module=dynamic \ - --with-http_slice_module \ - --with-mail \ - --with-mail_ssl_module \ - --with-compat \ - --with-file-aio \ - --with-http_v2_module \ - --add-module=/usr/src/ngx_devel_kit-$DEVEL_KIT_MODULE_VERSION \ - --add-module=/usr/src/lua-nginx-module-$LUA_MODULE_VERSION \ - " \ - && addgroup -S nginx \ - && adduser -D -S -h /var/cache/nginx -s /sbin/nologin -G nginx nginx \ - && apk add --no-cache --virtual .build-deps \ - autoconf \ - gcc \ - libc-dev \ - make \ - libressl-dev \ - pcre-dev \ - zlib-dev \ - linux-headers \ - curl \ - gnupg \ - libxslt-dev \ - gd-dev \ - # geoip-dev \ - libmaxminddb-dev \ - perl-dev \ - luajit-dev \ - && curl -fSL http://nginx.org/download/nginx-$NGINX_VERSION.tar.gz -o nginx.tar.gz \ - && 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/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 \ -# && export GNUPGHOME="$(mktemp -d)" \ -# && found=''; \ -# for server in \ -# ha.pool.sks-keyservers.net \ -# hkp://keyserver.ubuntu.com:80 \ -# hkp://p80.pool.sks-keyservers.net:80 \ -# pgp.mit.edu \ -# ; do \ -# echo "Fetching GPG key $GPG_KEYS from $server"; \ -# gpg --keyserver "$server" --keyserver-options timeout=10 --recv-keys "$GPG_KEYS" && found=yes && break; \ -# done; \ -# test -z "$found" && echo >&2 "error: failed to fetch GPG key $GPG_KEYS" && exit 1; \ -# gpg --batch --verify nginx.tar.gz.asc nginx.tar.gz \ - #&& rm -r "$GNUPGHOME" nginx.tar.gz.asc \ - && mkdir -p /usr/src \ - && tar -zxC /usr/src -f nginx.tar.gz \ - && tar -zxC /usr/src -f ndk.tar.gz \ - && tar -zxC /usr/src -f lua.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 \ - && cd /usr/src/nginx-$NGINX_VERSION \ - && ./configure $CONFIG --with-debug \ - && make -j$(getconf _NPROCESSORS_ONLN) \ - && 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_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_perl_module.so objs/ngx_http_perl_module-debug.so \ -# && mv objs/ngx_stream_geoip_module.so objs/ngx_stream_geoip_module-debug.so \ - && ./configure $CONFIG \ - && make -j$(getconf _NPROCESSORS_ONLN) \ - && make install \ - && rm -rf /etc/nginx/html/ \ - && mkdir /etc/nginx/conf.d/ \ - && mkdir -p /usr/share/nginx/html/ \ - && install -m644 html/index.html /usr/share/nginx/html/ \ - && install -m644 html/50x.html /usr/share/nginx/html/ \ - && 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_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_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 \ - && ln -s ../../usr/lib/nginx/modules /etc/nginx/modules \ - && strip /usr/sbin/nginx* \ - && strip /usr/lib/nginx/modules/*.so \ - && rm -rf /usr/src/nginx-$NGINX_VERSION \ -# && rm -rf /usr/src/ngx_http_geoip2_module-$GEOIP2_MODULE_VERSION \ - \ - # Bring in gettext so we can get `envsubst`, then throw - # the rest away. To do this, we need to install `gettext` - # then move `envsubst` out of the way so `gettext` can - # be deleted completely, then move `envsubst` back. - && apk add --no-cache --virtual .gettext gettext \ - && mv /usr/bin/envsubst /tmp/ \ - \ - && runDeps="$( \ - scanelf --needed --nobanner /usr/sbin/nginx /usr/lib/nginx/modules/*.so /tmp/envsubst \ - | awk '{ gsub(/,/, "\nso:", $2); print "so:" $2 }' \ - | sort -u \ - | xargs -r apk info --installed \ - | sort -u \ - )" \ - && apk add --no-cache --virtual .nginx-rundeps $runDeps \ - && apk del .build-deps \ - && apk del .gettext \ - && mv /tmp/envsubst /usr/local/bin/ \ - \ - # forward request and error logs to docker log collector - && ln -sf /dev/stdout /var/log/nginx/access.log \ - && ln -sf /dev/stderr /var/log/nginx/error.log + +# INstall nginx + lua and devel kit +RUN apk add --no-cach nginx \ + nginx-mod-http-lua \ + nginx-mod-devel-kit RUN echo @testing http://nl.alpinelinux.org/alpine/edge/testing >> /etc/apk/repositories && \ echo /etc/apk/respositories && \ @@ -175,12 +33,9 @@ RUN echo @testing http://nl.alpinelinux.org/alpine/edge/testing >> /etc/apk/repo git \ python3 \ py3-pip \ - ca-certificates \ dialog \ autoconf \ make \ - openssl-dev \ - libressl-dev \ libzip-dev \ bzip2-dev \ icu-dev \ @@ -198,25 +53,29 @@ RUN echo @testing http://nl.alpinelinux.org/alpine/edge/testing >> /etc/apk/repo sqlite-dev \ imap-dev \ libjpeg-turbo-dev \ - postgresql-dev && \ - docker-php-ext-configure gd \ + postgresql-dev \ + lua-resty-core + +# Install PHP modules +RUN docker-php-ext-configure gd \ --enable-gd \ --with-freetype \ --with-jpeg && \ docker-php-ext-install gd && \ pip install --upgrade pip && \ - #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 iconv pdo_mysql pdo_sqlite pgsql pdo_pgsql mysqli gd exif intl xsl json soap dom zip opcache && \ docker-php-ext-install pdo_mysql mysqli pdo_sqlite pgsql pdo_pgsql exif intl xsl soap zip && \ - pecl install xdebug-3.1.4 && \ - pecl install -o -f redis && \ + pecl install -o -f xdebug && \ + pecl install -o -f redis && \ echo "extension=redis.so" > /usr/local/etc/php/conf.d/redis.ini && \ - docker-php-source delete && \ - mkdir -p /etc/nginx && \ - mkdir -p /var/www/app && \ - mkdir -p /run/nginx && \ - mkdir -p /var/log/supervisor && \ + echo "zend_extension=xdebug" > /usr/local/etc/php/conf.d/xdebug.ini && \ + docker-php-source delete +# mkdir -p /etc/nginx && \ +# mkdir -p /var/www/app && \ +# mkdir -p /run/nginx && \ + + +# Install composer and certbot +RUN mkdir -p /var/log/supervisor && \ php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" && \ php composer-setup.php --quiet --install-dir=/usr/bin --filename=composer && \ rm composer-setup.php &&\ @@ -225,7 +84,6 @@ RUN echo @testing http://nl.alpinelinux.org/alpine/edge/testing >> /etc/apk/repo mkdir -p /etc/letsencrypt/webrootauth && \ apk del gcc musl-dev linux-headers libffi-dev augeas-dev python3-dev make autoconf && \ apk del .sys-deps -# ln -s /usr/bin/php7 /usr/bin/php ADD conf/supervisord.conf /etc/supervisord.conf diff --git a/README.md b/README.md index 188a41db..8fd464e9 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ If you have improvements or suggestions please open an issue or pull request on ### Versioning | Docker Tag | Git Release | Nginx Version | PHP Version | Alpine Version | |-----|-------|-----|--------|--------| -| latest/2.2.0 | Master Branch |1.22.1 | 8.1.12 | 3.16 | +| latest/3.0.0 | Master Branch |1.22.1 | 8.2.3 | 3.17 | For other tags please see: [versioning](https://github.com/richarvey/nginx-php-fpm/blob/master/docs/versioning.md) diff --git a/docs/versioning.md b/docs/versioning.md index 676dc1d3..5c486de1 100644 --- a/docs/versioning.md +++ b/docs/versioning.md @@ -13,11 +13,17 @@ 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. -#### PHP 8.x +#### PHP 8.2.x | Docker Tag | PHP Version | Nginx Version | Alpine Version | Container Scripts | Notes | |-----|-------|-----|--------|--------|----------| -| 2.2.0 | 8.1.12 |1.22.1 | 3.16 | 0.3.16 | nginx upgraded to 1.22.1 php to 8.1.12 | +| 3.0.0 | 8.2.3 |1.22.1 | 3.17 | 0.3.16 | upgraded php to 8.2.3 switched to packaged nginx | + +#### PHP 8.1.x + +| Docker Tag | PHP Version | Nginx Version | Alpine Version | Container Scripts | Notes | +|-----|-------|-----|--------|--------|----------| +| 2.2.1 | 8.1.12 |1.22.1 | 3.16 | 0.3.16 | nginx upgraded to 1.22.1 php to 8.1.12 | | 2.1.4 | 8.1.9 |1.21.6 | 3.16 | 0.3.16 | nginx upgraded to 1.22.0 | | 2.1.3 | 8.1.6 |1.22.0 | 3.15 | 0.3.16 | nginx upgraded to 1.22.0 | | 2.1.2 | 8.1.6 |1.21.6 | 3.15 | 0.3.16 | mod lua upgraded to 0.10.17 |