From 989de98414aa284d00ac6fd40cf5def4534eafd3 Mon Sep 17 00:00:00 2001 From: Philipp Holzer Date: Sun, 23 Jun 2019 02:24:02 +0200 Subject: [PATCH] Enhancing docker images: - Adding APCu - Bump PHP to 7.3 - Remove deprecated mcrypt - Dynamic version checking for depending PECL libraries - Add production default 512M for memory_limit (see https://github.com/friendica/docker/issues/56) - Re-Add FRIENDICA_PHP_PATH because of Bugfix in upstream --- .docker-files/entrypoint.sh | 3 +- 2019.04/apache/Dockerfile | 53 ++++++++++++++++++---------- 2019.04/apache/entrypoint.sh | 3 +- 2019.04/fpm-alpine/Dockerfile | 53 +++++++++++++++++++--------- 2019.04/fpm-alpine/entrypoint.sh | 3 +- 2019.04/fpm/Dockerfile | 53 ++++++++++++++++++---------- 2019.04/fpm/entrypoint.sh | 3 +- 2019.06-dev/apache/Dockerfile | 50 +++++++++++++++++--------- 2019.06-dev/apache/entrypoint.sh | 3 +- 2019.06-dev/fpm-alpine/Dockerfile | 50 +++++++++++++++++--------- 2019.06-dev/fpm-alpine/entrypoint.sh | 3 +- 2019.06-dev/fpm/Dockerfile | 50 +++++++++++++++++--------- 2019.06-dev/fpm/entrypoint.sh | 3 +- 2019.06-rc/apache/Dockerfile | 50 +++++++++++++++++--------- 2019.06-rc/apache/entrypoint.sh | 3 +- 2019.06-rc/fpm-alpine/Dockerfile | 50 +++++++++++++++++--------- 2019.06-rc/fpm-alpine/entrypoint.sh | 3 +- 2019.06-rc/fpm/Dockerfile | 50 +++++++++++++++++--------- 2019.06-rc/fpm/entrypoint.sh | 3 +- Dockerfile-alpine.template | 44 ++++++++++++++++------- Dockerfile-debian.template | 46 ++++++++++++++++-------- update.sh | 50 ++++++++++++++++++++++---- 22 files changed, 422 insertions(+), 207 deletions(-) diff --git a/.docker-files/entrypoint.sh b/.docker-files/entrypoint.sh index 2d0bcf2..26fe25a 100644 --- a/.docker-files/entrypoint.sh +++ b/.docker-files/entrypoint.sh @@ -141,8 +141,7 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ]; then if [ -n "${MYSQL_DATABASE+x}" ] && [ -n "${MYSQL_PASSWORD+x}" ] && [ -n "${MYSQL_HOST+x}" ] && [ -n "${MYSQL_USER+x}" -o -n "${MYSQL_USERNAME+x}" ] && [ -n ${FRIENDICA_ADMIN_MAIL+x} ]; then echo "Installation with environment variables" - # TODO Bug in PHP Path for automatic installation - #FRIENDICA_PHP_PATH=${FRIENDICA_PHP_PATH:-/usr/local/php} + FRIENDICA_PHP_PATH=${FRIENDICA_PHP_PATH:-/usr/local/php} FRIENDICA_TZ=${FRIENDICA_TZ:-America/LosAngeles} FRIENDICA_LANG=${FRIENDICA_LANG:-en} MYSQL_PORT=${MYSQL_PORT:-3306} diff --git a/2019.04/apache/Dockerfile b/2019.04/apache/Dockerfile index d8a6fc5..f14227d 100644 --- a/2019.04/apache/Dockerfile +++ b/2019.04/apache/Dockerfile @@ -1,5 +1,5 @@ # DO NOT EDIT: created by update.sh from Dockerfile-debian.template -FROM php:7.1-apache +FROM php:7.3-apache-stretch LABEL maintainer="Philipp Holzer " # entrypoint.sh and cron.sh dependencies @@ -34,8 +34,6 @@ RUN set -ex; \ libpng-dev \ libjpeg62-turbo-dev \ libtool \ - libmcrypt4 \ - libmcrypt-dev \ imagemagick \ libmagick++-dev \ libmemcached-dev \ @@ -45,29 +43,43 @@ RUN set -ex; \ librsvg2-2 \ libcurl4-openssl-dev \ curl \ + libzip-dev \ ; \ \ debMultiarch="$(dpkg-architecture --query DEB_BUILD_MULTIARCH)"; \ - pecl install imagick-3.4.3; \ - docker-php-ext-enable imagick; \ - pecl clear-cache \ - ; \ + \ docker-php-ext-configure gd \ --with-gd \ - --enable-gd-native-ttf \ --with-freetype-dir=/usr/include/ \ --with-png-dir=/usr/include/ \ --with-jpeg-dir=/usr/include/ \ ; \ - docker-php-ext-install -j 4 curl pdo pdo_mysql xml gd zip opcache mbstring posix ctype json iconv mcrypt \ + docker-php-ext-install -j 4 \ + curl \ + pdo \ + pdo_mysql \ + xml \ + gd \ + zip \ + opcache \ + mbstring \ + posix \ + ctype \ + json \ + iconv \ ; \ + \ # pecl will claim success even if one install fails, so we need to perform each install separately - pecl install memcached-3.0.4; \ - pecl install redis-3.1.6; \ + pecl install apcu-5.1.17; \ + pecl install memcached-3.1.3; \ + pecl install redis-4.3.0; \ + pecl install imagick-3.4.4; \ \ docker-php-ext-enable \ + apcu \ memcached \ redis \ + imagick \ ; \ \ # reset apt-mark's "manual" list so that "purge --auto-remove" will remove all build dependencies @@ -84,11 +96,19 @@ RUN set -ex; \ apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \ rm -rf /var/lib/apt/lists/* -RUN chown -R www-data:root /var/www; \ +RUN {\ + echo sendmail_path = "/usr/sbin/sendmail -t -i" ;\ + } > /usr/local/etc/php/conf.d/sendmail.ini; \ + \ + echo 'apc.enable_cli=1' >> /usr/local/etc/php/conf.d/docker-php-ext-apcu.ini; \ + \ + echo 'memory_limit=512M' > /usr/local/etc/php/conf.d/memory-limit.ini; \ + \ + mkdir /var/www/data; \ + chown -R www-data:root /var/www; \ chmod -R g=u /var/www VOLUME /var/www/html -WORKDIR /var/www/html RUN a2enmod rewrite remoteip ;\ {\ @@ -99,10 +119,6 @@ RUN a2enmod rewrite remoteip ;\ } > /etc/apache2/conf-available/remoteip.conf;\ a2enconf remoteip -RUN {\ - echo sendmail_path = "/usr/sbin/sendmail -t -i" ;\ - } > /usr/local/etc/php/conf.d/sendmail.ini; - COPY *.sh upgrade.exclude / RUN chmod +x /*.sh @@ -118,7 +134,8 @@ RUN set -ex; \ chmod 777 /usr/src/friendica/view/smarty3; \ curl -fsSL -o friendica_addons.tar.gz \ "https://github.com/friendica/friendica-addons/archive/${FRIENDICA_ADDONS}.tar.gz"; \ - mkdir /usr/src/friendica/addon; \ + mkdir -p /usr/src/friendica/proxy; \ + mkdir -p /usr/src/friendica/addon; \ tar -xzf friendica_addons.tar.gz -C /usr/src/friendica/addon --strip-components=1; \ rm friendica_addons.tar.gz; \ /usr/src/friendica/bin/composer.phar install --no-dev -d /usr/src/friendica; diff --git a/2019.04/apache/entrypoint.sh b/2019.04/apache/entrypoint.sh index 2d0bcf2..26fe25a 100644 --- a/2019.04/apache/entrypoint.sh +++ b/2019.04/apache/entrypoint.sh @@ -141,8 +141,7 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ]; then if [ -n "${MYSQL_DATABASE+x}" ] && [ -n "${MYSQL_PASSWORD+x}" ] && [ -n "${MYSQL_HOST+x}" ] && [ -n "${MYSQL_USER+x}" -o -n "${MYSQL_USERNAME+x}" ] && [ -n ${FRIENDICA_ADMIN_MAIL+x} ]; then echo "Installation with environment variables" - # TODO Bug in PHP Path for automatic installation - #FRIENDICA_PHP_PATH=${FRIENDICA_PHP_PATH:-/usr/local/php} + FRIENDICA_PHP_PATH=${FRIENDICA_PHP_PATH:-/usr/local/php} FRIENDICA_TZ=${FRIENDICA_TZ:-America/LosAngeles} FRIENDICA_LANG=${FRIENDICA_LANG:-en} MYSQL_PORT=${MYSQL_PORT:-3306} diff --git a/2019.04/fpm-alpine/Dockerfile b/2019.04/fpm-alpine/Dockerfile index 4dbda59..09f10b7 100644 --- a/2019.04/fpm-alpine/Dockerfile +++ b/2019.04/fpm-alpine/Dockerfile @@ -1,5 +1,5 @@ # DO NOT EDIT: created by update.sh from Dockerfile-alpine.template -FROM php:7.1-fpm-alpine +FROM php:7.3-fpm-alpine LABEL maintainer="Philipp Holzer " # entrypoint.sh and cron.sh dependencies @@ -29,8 +29,6 @@ RUN set -ex; \ imagemagick-dev \ imagemagick \ libtool \ - libmcrypt \ - libmcrypt-dev \ libmemcached-dev \ cyrus-sasl-dev \ freetype \ @@ -44,26 +42,42 @@ RUN set -ex; \ rsync \ bzip2 \ pcre-dev \ + libzip-dev \ ; \ - pecl install imagick-3.4.3; \ - docker-php-ext-enable imagick; \ - pecl clear-cache; \ + \ docker-php-ext-configure gd \ --with-gd \ - --enable-gd-native-ttf \ --with-freetype-dir=/usr/include/ \ --with-png-dir=/usr/include/ \ --with-jpeg-dir=/usr/include/ \ ; \ - docker-php-ext-install -j 4 curl pdo pdo_mysql xml gd zip opcache mbstring posix ctype json iconv mcrypt; \ + \ + docker-php-ext-install -j 4 \ + curl \ + pdo \ + pdo_mysql \ + xml \ + gd \ + zip \ + opcache \ + mbstring \ + posix \ + ctype \ + json \ + iconv \ + ; \ \ # pecl will claim success even if one install fails, so we need to perform each install separately - pecl install memcached-3.0.4; \ - pecl install redis-3.1.6; \ + pecl install APCu-5.1.17; \ + pecl install memcached-3.1.3; \ + pecl install redis-4.3.0; \ + pecl install imagick-3.4.4; \ \ docker-php-ext-enable \ + apcu \ memcached \ redis \ + imagick \ ; \ \ runDeps="$( \ @@ -75,17 +89,21 @@ RUN set -ex; \ apk add --virtual .friendica-phpext-rundeps $runDeps; \ apk del .build-deps; -RUN chown -R www-data:www-data /var/www; \ +RUN {\ + echo sendmail_path = "/usr/sbin/sendmail -t -i" ;\ + } > /usr/local/etc/php/conf.d/sendmail.ini; \ + \ + echo 'apc.enable_cli=1' >> /usr/local/etc/php/conf.d/docker-php-ext-apcu.ini; \ + \ + echo 'memory_limit=512M' > /usr/local/etc/php/conf.d/memory-limit.ini; \ + \ + mkdir /var/www/data; \ + chown -R www-data:root /var/www; \ chmod -R g=u /var/www VOLUME /var/www/html -WORKDIR /var/www/html -RUN {\ - echo sendmail_path = "/usr/sbin/sendmail -t -i" ;\ - } > /usr/local/etc/php/conf.d/sendmail.ini; - COPY *.sh upgrade.exclude / RUN chmod +x /*.sh @@ -101,7 +119,8 @@ RUN set -ex; \ chmod 777 /usr/src/friendica/view/smarty3; \ curl -fsSL -o friendica_addons.tar.gz \ "https://github.com/friendica/friendica-addons/archive/${FRIENDICA_ADDONS}.tar.gz"; \ - mkdir /usr/src/friendica/addon; \ + mkdir -p /usr/src/friendica/proxy; \ + mkdir -p /usr/src/friendica/addon; \ tar -xzf friendica_addons.tar.gz -C /usr/src/friendica/addon --strip-components=1; \ rm friendica_addons.tar.gz; \ /usr/src/friendica/bin/composer.phar install --no-dev -d /usr/src/friendica; diff --git a/2019.04/fpm-alpine/entrypoint.sh b/2019.04/fpm-alpine/entrypoint.sh index 2d0bcf2..26fe25a 100644 --- a/2019.04/fpm-alpine/entrypoint.sh +++ b/2019.04/fpm-alpine/entrypoint.sh @@ -141,8 +141,7 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ]; then if [ -n "${MYSQL_DATABASE+x}" ] && [ -n "${MYSQL_PASSWORD+x}" ] && [ -n "${MYSQL_HOST+x}" ] && [ -n "${MYSQL_USER+x}" -o -n "${MYSQL_USERNAME+x}" ] && [ -n ${FRIENDICA_ADMIN_MAIL+x} ]; then echo "Installation with environment variables" - # TODO Bug in PHP Path for automatic installation - #FRIENDICA_PHP_PATH=${FRIENDICA_PHP_PATH:-/usr/local/php} + FRIENDICA_PHP_PATH=${FRIENDICA_PHP_PATH:-/usr/local/php} FRIENDICA_TZ=${FRIENDICA_TZ:-America/LosAngeles} FRIENDICA_LANG=${FRIENDICA_LANG:-en} MYSQL_PORT=${MYSQL_PORT:-3306} diff --git a/2019.04/fpm/Dockerfile b/2019.04/fpm/Dockerfile index a8dc36e..9369a5b 100644 --- a/2019.04/fpm/Dockerfile +++ b/2019.04/fpm/Dockerfile @@ -1,5 +1,5 @@ # DO NOT EDIT: created by update.sh from Dockerfile-debian.template -FROM php:7.1-fpm +FROM php:7.3-fpm-stretch LABEL maintainer="Philipp Holzer " # entrypoint.sh and cron.sh dependencies @@ -34,8 +34,6 @@ RUN set -ex; \ libpng-dev \ libjpeg62-turbo-dev \ libtool \ - libmcrypt4 \ - libmcrypt-dev \ imagemagick \ libmagick++-dev \ libmemcached-dev \ @@ -45,29 +43,43 @@ RUN set -ex; \ librsvg2-2 \ libcurl4-openssl-dev \ curl \ + libzip-dev \ ; \ \ debMultiarch="$(dpkg-architecture --query DEB_BUILD_MULTIARCH)"; \ - pecl install imagick-3.4.3; \ - docker-php-ext-enable imagick; \ - pecl clear-cache \ - ; \ + \ docker-php-ext-configure gd \ --with-gd \ - --enable-gd-native-ttf \ --with-freetype-dir=/usr/include/ \ --with-png-dir=/usr/include/ \ --with-jpeg-dir=/usr/include/ \ ; \ - docker-php-ext-install -j 4 curl pdo pdo_mysql xml gd zip opcache mbstring posix ctype json iconv mcrypt \ + docker-php-ext-install -j 4 \ + curl \ + pdo \ + pdo_mysql \ + xml \ + gd \ + zip \ + opcache \ + mbstring \ + posix \ + ctype \ + json \ + iconv \ ; \ + \ # pecl will claim success even if one install fails, so we need to perform each install separately - pecl install memcached-3.0.4; \ - pecl install redis-3.1.6; \ + pecl install apcu-5.1.17; \ + pecl install memcached-3.1.3; \ + pecl install redis-4.3.0; \ + pecl install imagick-3.4.4; \ \ docker-php-ext-enable \ + apcu \ memcached \ redis \ + imagick \ ; \ \ # reset apt-mark's "manual" list so that "purge --auto-remove" will remove all build dependencies @@ -84,17 +96,21 @@ RUN set -ex; \ apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \ rm -rf /var/lib/apt/lists/* -RUN chown -R www-data:root /var/www; \ +RUN {\ + echo sendmail_path = "/usr/sbin/sendmail -t -i" ;\ + } > /usr/local/etc/php/conf.d/sendmail.ini; \ + \ + echo 'apc.enable_cli=1' >> /usr/local/etc/php/conf.d/docker-php-ext-apcu.ini; \ + \ + echo 'memory_limit=512M' > /usr/local/etc/php/conf.d/memory-limit.ini; \ + \ + mkdir /var/www/data; \ + chown -R www-data:root /var/www; \ chmod -R g=u /var/www VOLUME /var/www/html -WORKDIR /var/www/html -RUN {\ - echo sendmail_path = "/usr/sbin/sendmail -t -i" ;\ - } > /usr/local/etc/php/conf.d/sendmail.ini; - COPY *.sh upgrade.exclude / RUN chmod +x /*.sh @@ -110,7 +126,8 @@ RUN set -ex; \ chmod 777 /usr/src/friendica/view/smarty3; \ curl -fsSL -o friendica_addons.tar.gz \ "https://github.com/friendica/friendica-addons/archive/${FRIENDICA_ADDONS}.tar.gz"; \ - mkdir /usr/src/friendica/addon; \ + mkdir -p /usr/src/friendica/proxy; \ + mkdir -p /usr/src/friendica/addon; \ tar -xzf friendica_addons.tar.gz -C /usr/src/friendica/addon --strip-components=1; \ rm friendica_addons.tar.gz; \ /usr/src/friendica/bin/composer.phar install --no-dev -d /usr/src/friendica; diff --git a/2019.04/fpm/entrypoint.sh b/2019.04/fpm/entrypoint.sh index 2d0bcf2..26fe25a 100644 --- a/2019.04/fpm/entrypoint.sh +++ b/2019.04/fpm/entrypoint.sh @@ -141,8 +141,7 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ]; then if [ -n "${MYSQL_DATABASE+x}" ] && [ -n "${MYSQL_PASSWORD+x}" ] && [ -n "${MYSQL_HOST+x}" ] && [ -n "${MYSQL_USER+x}" -o -n "${MYSQL_USERNAME+x}" ] && [ -n ${FRIENDICA_ADMIN_MAIL+x} ]; then echo "Installation with environment variables" - # TODO Bug in PHP Path for automatic installation - #FRIENDICA_PHP_PATH=${FRIENDICA_PHP_PATH:-/usr/local/php} + FRIENDICA_PHP_PATH=${FRIENDICA_PHP_PATH:-/usr/local/php} FRIENDICA_TZ=${FRIENDICA_TZ:-America/LosAngeles} FRIENDICA_LANG=${FRIENDICA_LANG:-en} MYSQL_PORT=${MYSQL_PORT:-3306} diff --git a/2019.06-dev/apache/Dockerfile b/2019.06-dev/apache/Dockerfile index 8a01680..705ec55 100644 --- a/2019.06-dev/apache/Dockerfile +++ b/2019.06-dev/apache/Dockerfile @@ -1,5 +1,5 @@ # DO NOT EDIT: created by update.sh from Dockerfile-debian.template -FROM php:7.1-apache +FROM php:7.3-apache-stretch LABEL maintainer="Philipp Holzer " # entrypoint.sh and cron.sh dependencies @@ -34,8 +34,6 @@ RUN set -ex; \ libpng-dev \ libjpeg62-turbo-dev \ libtool \ - libmcrypt4 \ - libmcrypt-dev \ imagemagick \ libmagick++-dev \ libmemcached-dev \ @@ -45,29 +43,43 @@ RUN set -ex; \ librsvg2-2 \ libcurl4-openssl-dev \ curl \ + libzip-dev \ ; \ \ debMultiarch="$(dpkg-architecture --query DEB_BUILD_MULTIARCH)"; \ - pecl install imagick-3.4.3; \ - docker-php-ext-enable imagick; \ - pecl clear-cache \ - ; \ + \ docker-php-ext-configure gd \ --with-gd \ - --enable-gd-native-ttf \ --with-freetype-dir=/usr/include/ \ --with-png-dir=/usr/include/ \ --with-jpeg-dir=/usr/include/ \ ; \ - docker-php-ext-install -j 4 curl pdo pdo_mysql xml gd zip opcache mbstring posix ctype json iconv mcrypt \ + docker-php-ext-install -j 4 \ + curl \ + pdo \ + pdo_mysql \ + xml \ + gd \ + zip \ + opcache \ + mbstring \ + posix \ + ctype \ + json \ + iconv \ ; \ + \ # pecl will claim success even if one install fails, so we need to perform each install separately - pecl install memcached-3.0.4; \ - pecl install redis-3.1.6; \ + pecl install apcu-5.1.17; \ + pecl install memcached-3.1.3; \ + pecl install redis-4.3.0; \ + pecl install imagick-3.4.4; \ \ docker-php-ext-enable \ + apcu \ memcached \ redis \ + imagick \ ; \ \ # reset apt-mark's "manual" list so that "purge --auto-remove" will remove all build dependencies @@ -84,11 +96,19 @@ RUN set -ex; \ apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \ rm -rf /var/lib/apt/lists/* -RUN chown -R www-data:root /var/www; \ +RUN {\ + echo sendmail_path = "/usr/sbin/sendmail -t -i" ;\ + } > /usr/local/etc/php/conf.d/sendmail.ini; \ + \ + echo 'apc.enable_cli=1' >> /usr/local/etc/php/conf.d/docker-php-ext-apcu.ini; \ + \ + echo 'memory_limit=512M' > /usr/local/etc/php/conf.d/memory-limit.ini; \ + \ + mkdir /var/www/data; \ + chown -R www-data:root /var/www; \ chmod -R g=u /var/www VOLUME /var/www/html -WORKDIR /var/www/html RUN a2enmod rewrite remoteip ;\ {\ @@ -99,10 +119,6 @@ RUN a2enmod rewrite remoteip ;\ } > /etc/apache2/conf-available/remoteip.conf;\ a2enconf remoteip -RUN {\ - echo sendmail_path = "/usr/sbin/sendmail -t -i" ;\ - } > /usr/local/etc/php/conf.d/sendmail.ini; - COPY *.sh upgrade.exclude / RUN chmod +x /*.sh diff --git a/2019.06-dev/apache/entrypoint.sh b/2019.06-dev/apache/entrypoint.sh index 2d0bcf2..26fe25a 100644 --- a/2019.06-dev/apache/entrypoint.sh +++ b/2019.06-dev/apache/entrypoint.sh @@ -141,8 +141,7 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ]; then if [ -n "${MYSQL_DATABASE+x}" ] && [ -n "${MYSQL_PASSWORD+x}" ] && [ -n "${MYSQL_HOST+x}" ] && [ -n "${MYSQL_USER+x}" -o -n "${MYSQL_USERNAME+x}" ] && [ -n ${FRIENDICA_ADMIN_MAIL+x} ]; then echo "Installation with environment variables" - # TODO Bug in PHP Path for automatic installation - #FRIENDICA_PHP_PATH=${FRIENDICA_PHP_PATH:-/usr/local/php} + FRIENDICA_PHP_PATH=${FRIENDICA_PHP_PATH:-/usr/local/php} FRIENDICA_TZ=${FRIENDICA_TZ:-America/LosAngeles} FRIENDICA_LANG=${FRIENDICA_LANG:-en} MYSQL_PORT=${MYSQL_PORT:-3306} diff --git a/2019.06-dev/fpm-alpine/Dockerfile b/2019.06-dev/fpm-alpine/Dockerfile index da01cbd..92c7101 100644 --- a/2019.06-dev/fpm-alpine/Dockerfile +++ b/2019.06-dev/fpm-alpine/Dockerfile @@ -1,5 +1,5 @@ # DO NOT EDIT: created by update.sh from Dockerfile-alpine.template -FROM php:7.1-fpm-alpine +FROM php:7.3-fpm-alpine LABEL maintainer="Philipp Holzer " # entrypoint.sh and cron.sh dependencies @@ -29,8 +29,6 @@ RUN set -ex; \ imagemagick-dev \ imagemagick \ libtool \ - libmcrypt \ - libmcrypt-dev \ libmemcached-dev \ cyrus-sasl-dev \ freetype \ @@ -44,26 +42,42 @@ RUN set -ex; \ rsync \ bzip2 \ pcre-dev \ + libzip-dev \ ; \ - pecl install imagick-3.4.3; \ - docker-php-ext-enable imagick; \ - pecl clear-cache; \ + \ docker-php-ext-configure gd \ --with-gd \ - --enable-gd-native-ttf \ --with-freetype-dir=/usr/include/ \ --with-png-dir=/usr/include/ \ --with-jpeg-dir=/usr/include/ \ ; \ - docker-php-ext-install -j 4 curl pdo pdo_mysql xml gd zip opcache mbstring posix ctype json iconv mcrypt; \ + \ + docker-php-ext-install -j 4 \ + curl \ + pdo \ + pdo_mysql \ + xml \ + gd \ + zip \ + opcache \ + mbstring \ + posix \ + ctype \ + json \ + iconv \ + ; \ \ # pecl will claim success even if one install fails, so we need to perform each install separately - pecl install memcached-3.0.4; \ - pecl install redis-3.1.6; \ + pecl install APCu-5.1.17; \ + pecl install memcached-3.1.3; \ + pecl install redis-4.3.0; \ + pecl install imagick-3.4.4; \ \ docker-php-ext-enable \ + apcu \ memcached \ redis \ + imagick \ ; \ \ runDeps="$( \ @@ -75,17 +89,21 @@ RUN set -ex; \ apk add --virtual .friendica-phpext-rundeps $runDeps; \ apk del .build-deps; -RUN chown -R www-data:www-data /var/www; \ +RUN {\ + echo sendmail_path = "/usr/sbin/sendmail -t -i" ;\ + } > /usr/local/etc/php/conf.d/sendmail.ini; \ + \ + echo 'apc.enable_cli=1' >> /usr/local/etc/php/conf.d/docker-php-ext-apcu.ini; \ + \ + echo 'memory_limit=512M' > /usr/local/etc/php/conf.d/memory-limit.ini; \ + \ + mkdir /var/www/data; \ + chown -R www-data:root /var/www; \ chmod -R g=u /var/www VOLUME /var/www/html -WORKDIR /var/www/html -RUN {\ - echo sendmail_path = "/usr/sbin/sendmail -t -i" ;\ - } > /usr/local/etc/php/conf.d/sendmail.ini; - COPY *.sh upgrade.exclude / RUN chmod +x /*.sh diff --git a/2019.06-dev/fpm-alpine/entrypoint.sh b/2019.06-dev/fpm-alpine/entrypoint.sh index 2d0bcf2..26fe25a 100644 --- a/2019.06-dev/fpm-alpine/entrypoint.sh +++ b/2019.06-dev/fpm-alpine/entrypoint.sh @@ -141,8 +141,7 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ]; then if [ -n "${MYSQL_DATABASE+x}" ] && [ -n "${MYSQL_PASSWORD+x}" ] && [ -n "${MYSQL_HOST+x}" ] && [ -n "${MYSQL_USER+x}" -o -n "${MYSQL_USERNAME+x}" ] && [ -n ${FRIENDICA_ADMIN_MAIL+x} ]; then echo "Installation with environment variables" - # TODO Bug in PHP Path for automatic installation - #FRIENDICA_PHP_PATH=${FRIENDICA_PHP_PATH:-/usr/local/php} + FRIENDICA_PHP_PATH=${FRIENDICA_PHP_PATH:-/usr/local/php} FRIENDICA_TZ=${FRIENDICA_TZ:-America/LosAngeles} FRIENDICA_LANG=${FRIENDICA_LANG:-en} MYSQL_PORT=${MYSQL_PORT:-3306} diff --git a/2019.06-dev/fpm/Dockerfile b/2019.06-dev/fpm/Dockerfile index a9cad1e..15b15bf 100644 --- a/2019.06-dev/fpm/Dockerfile +++ b/2019.06-dev/fpm/Dockerfile @@ -1,5 +1,5 @@ # DO NOT EDIT: created by update.sh from Dockerfile-debian.template -FROM php:7.1-fpm +FROM php:7.3-fpm-stretch LABEL maintainer="Philipp Holzer " # entrypoint.sh and cron.sh dependencies @@ -34,8 +34,6 @@ RUN set -ex; \ libpng-dev \ libjpeg62-turbo-dev \ libtool \ - libmcrypt4 \ - libmcrypt-dev \ imagemagick \ libmagick++-dev \ libmemcached-dev \ @@ -45,29 +43,43 @@ RUN set -ex; \ librsvg2-2 \ libcurl4-openssl-dev \ curl \ + libzip-dev \ ; \ \ debMultiarch="$(dpkg-architecture --query DEB_BUILD_MULTIARCH)"; \ - pecl install imagick-3.4.3; \ - docker-php-ext-enable imagick; \ - pecl clear-cache \ - ; \ + \ docker-php-ext-configure gd \ --with-gd \ - --enable-gd-native-ttf \ --with-freetype-dir=/usr/include/ \ --with-png-dir=/usr/include/ \ --with-jpeg-dir=/usr/include/ \ ; \ - docker-php-ext-install -j 4 curl pdo pdo_mysql xml gd zip opcache mbstring posix ctype json iconv mcrypt \ + docker-php-ext-install -j 4 \ + curl \ + pdo \ + pdo_mysql \ + xml \ + gd \ + zip \ + opcache \ + mbstring \ + posix \ + ctype \ + json \ + iconv \ ; \ + \ # pecl will claim success even if one install fails, so we need to perform each install separately - pecl install memcached-3.0.4; \ - pecl install redis-3.1.6; \ + pecl install apcu-5.1.17; \ + pecl install memcached-3.1.3; \ + pecl install redis-4.3.0; \ + pecl install imagick-3.4.4; \ \ docker-php-ext-enable \ + apcu \ memcached \ redis \ + imagick \ ; \ \ # reset apt-mark's "manual" list so that "purge --auto-remove" will remove all build dependencies @@ -84,17 +96,21 @@ RUN set -ex; \ apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \ rm -rf /var/lib/apt/lists/* -RUN chown -R www-data:root /var/www; \ +RUN {\ + echo sendmail_path = "/usr/sbin/sendmail -t -i" ;\ + } > /usr/local/etc/php/conf.d/sendmail.ini; \ + \ + echo 'apc.enable_cli=1' >> /usr/local/etc/php/conf.d/docker-php-ext-apcu.ini; \ + \ + echo 'memory_limit=512M' > /usr/local/etc/php/conf.d/memory-limit.ini; \ + \ + mkdir /var/www/data; \ + chown -R www-data:root /var/www; \ chmod -R g=u /var/www VOLUME /var/www/html -WORKDIR /var/www/html -RUN {\ - echo sendmail_path = "/usr/sbin/sendmail -t -i" ;\ - } > /usr/local/etc/php/conf.d/sendmail.ini; - COPY *.sh upgrade.exclude / RUN chmod +x /*.sh diff --git a/2019.06-dev/fpm/entrypoint.sh b/2019.06-dev/fpm/entrypoint.sh index 2d0bcf2..26fe25a 100644 --- a/2019.06-dev/fpm/entrypoint.sh +++ b/2019.06-dev/fpm/entrypoint.sh @@ -141,8 +141,7 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ]; then if [ -n "${MYSQL_DATABASE+x}" ] && [ -n "${MYSQL_PASSWORD+x}" ] && [ -n "${MYSQL_HOST+x}" ] && [ -n "${MYSQL_USER+x}" -o -n "${MYSQL_USERNAME+x}" ] && [ -n ${FRIENDICA_ADMIN_MAIL+x} ]; then echo "Installation with environment variables" - # TODO Bug in PHP Path for automatic installation - #FRIENDICA_PHP_PATH=${FRIENDICA_PHP_PATH:-/usr/local/php} + FRIENDICA_PHP_PATH=${FRIENDICA_PHP_PATH:-/usr/local/php} FRIENDICA_TZ=${FRIENDICA_TZ:-America/LosAngeles} FRIENDICA_LANG=${FRIENDICA_LANG:-en} MYSQL_PORT=${MYSQL_PORT:-3306} diff --git a/2019.06-rc/apache/Dockerfile b/2019.06-rc/apache/Dockerfile index 1be1c34..49dda89 100644 --- a/2019.06-rc/apache/Dockerfile +++ b/2019.06-rc/apache/Dockerfile @@ -1,5 +1,5 @@ # DO NOT EDIT: created by update.sh from Dockerfile-debian.template -FROM php:7.1-apache +FROM php:7.3-apache-stretch LABEL maintainer="Philipp Holzer " # entrypoint.sh and cron.sh dependencies @@ -34,8 +34,6 @@ RUN set -ex; \ libpng-dev \ libjpeg62-turbo-dev \ libtool \ - libmcrypt4 \ - libmcrypt-dev \ imagemagick \ libmagick++-dev \ libmemcached-dev \ @@ -45,29 +43,43 @@ RUN set -ex; \ librsvg2-2 \ libcurl4-openssl-dev \ curl \ + libzip-dev \ ; \ \ debMultiarch="$(dpkg-architecture --query DEB_BUILD_MULTIARCH)"; \ - pecl install imagick-3.4.3; \ - docker-php-ext-enable imagick; \ - pecl clear-cache \ - ; \ + \ docker-php-ext-configure gd \ --with-gd \ - --enable-gd-native-ttf \ --with-freetype-dir=/usr/include/ \ --with-png-dir=/usr/include/ \ --with-jpeg-dir=/usr/include/ \ ; \ - docker-php-ext-install -j 4 curl pdo pdo_mysql xml gd zip opcache mbstring posix ctype json iconv mcrypt \ + docker-php-ext-install -j 4 \ + curl \ + pdo \ + pdo_mysql \ + xml \ + gd \ + zip \ + opcache \ + mbstring \ + posix \ + ctype \ + json \ + iconv \ ; \ + \ # pecl will claim success even if one install fails, so we need to perform each install separately - pecl install memcached-3.0.4; \ - pecl install redis-3.1.6; \ + pecl install apcu-5.1.17; \ + pecl install memcached-3.1.3; \ + pecl install redis-4.3.0; \ + pecl install imagick-3.4.4; \ \ docker-php-ext-enable \ + apcu \ memcached \ redis \ + imagick \ ; \ \ # reset apt-mark's "manual" list so that "purge --auto-remove" will remove all build dependencies @@ -84,11 +96,19 @@ RUN set -ex; \ apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \ rm -rf /var/lib/apt/lists/* -RUN chown -R www-data:root /var/www; \ +RUN {\ + echo sendmail_path = "/usr/sbin/sendmail -t -i" ;\ + } > /usr/local/etc/php/conf.d/sendmail.ini; \ + \ + echo 'apc.enable_cli=1' >> /usr/local/etc/php/conf.d/docker-php-ext-apcu.ini; \ + \ + echo 'memory_limit=512M' > /usr/local/etc/php/conf.d/memory-limit.ini; \ + \ + mkdir /var/www/data; \ + chown -R www-data:root /var/www; \ chmod -R g=u /var/www VOLUME /var/www/html -WORKDIR /var/www/html RUN a2enmod rewrite remoteip ;\ {\ @@ -99,10 +119,6 @@ RUN a2enmod rewrite remoteip ;\ } > /etc/apache2/conf-available/remoteip.conf;\ a2enconf remoteip -RUN {\ - echo sendmail_path = "/usr/sbin/sendmail -t -i" ;\ - } > /usr/local/etc/php/conf.d/sendmail.ini; - COPY *.sh upgrade.exclude / RUN chmod +x /*.sh diff --git a/2019.06-rc/apache/entrypoint.sh b/2019.06-rc/apache/entrypoint.sh index 2d0bcf2..26fe25a 100644 --- a/2019.06-rc/apache/entrypoint.sh +++ b/2019.06-rc/apache/entrypoint.sh @@ -141,8 +141,7 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ]; then if [ -n "${MYSQL_DATABASE+x}" ] && [ -n "${MYSQL_PASSWORD+x}" ] && [ -n "${MYSQL_HOST+x}" ] && [ -n "${MYSQL_USER+x}" -o -n "${MYSQL_USERNAME+x}" ] && [ -n ${FRIENDICA_ADMIN_MAIL+x} ]; then echo "Installation with environment variables" - # TODO Bug in PHP Path for automatic installation - #FRIENDICA_PHP_PATH=${FRIENDICA_PHP_PATH:-/usr/local/php} + FRIENDICA_PHP_PATH=${FRIENDICA_PHP_PATH:-/usr/local/php} FRIENDICA_TZ=${FRIENDICA_TZ:-America/LosAngeles} FRIENDICA_LANG=${FRIENDICA_LANG:-en} MYSQL_PORT=${MYSQL_PORT:-3306} diff --git a/2019.06-rc/fpm-alpine/Dockerfile b/2019.06-rc/fpm-alpine/Dockerfile index 4fe04b3..868bcf7 100644 --- a/2019.06-rc/fpm-alpine/Dockerfile +++ b/2019.06-rc/fpm-alpine/Dockerfile @@ -1,5 +1,5 @@ # DO NOT EDIT: created by update.sh from Dockerfile-alpine.template -FROM php:7.1-fpm-alpine +FROM php:7.3-fpm-alpine LABEL maintainer="Philipp Holzer " # entrypoint.sh and cron.sh dependencies @@ -29,8 +29,6 @@ RUN set -ex; \ imagemagick-dev \ imagemagick \ libtool \ - libmcrypt \ - libmcrypt-dev \ libmemcached-dev \ cyrus-sasl-dev \ freetype \ @@ -44,26 +42,42 @@ RUN set -ex; \ rsync \ bzip2 \ pcre-dev \ + libzip-dev \ ; \ - pecl install imagick-3.4.3; \ - docker-php-ext-enable imagick; \ - pecl clear-cache; \ + \ docker-php-ext-configure gd \ --with-gd \ - --enable-gd-native-ttf \ --with-freetype-dir=/usr/include/ \ --with-png-dir=/usr/include/ \ --with-jpeg-dir=/usr/include/ \ ; \ - docker-php-ext-install -j 4 curl pdo pdo_mysql xml gd zip opcache mbstring posix ctype json iconv mcrypt; \ + \ + docker-php-ext-install -j 4 \ + curl \ + pdo \ + pdo_mysql \ + xml \ + gd \ + zip \ + opcache \ + mbstring \ + posix \ + ctype \ + json \ + iconv \ + ; \ \ # pecl will claim success even if one install fails, so we need to perform each install separately - pecl install memcached-3.0.4; \ - pecl install redis-3.1.6; \ + pecl install APCu-5.1.17; \ + pecl install memcached-3.1.3; \ + pecl install redis-4.3.0; \ + pecl install imagick-3.4.4; \ \ docker-php-ext-enable \ + apcu \ memcached \ redis \ + imagick \ ; \ \ runDeps="$( \ @@ -75,17 +89,21 @@ RUN set -ex; \ apk add --virtual .friendica-phpext-rundeps $runDeps; \ apk del .build-deps; -RUN chown -R www-data:www-data /var/www; \ +RUN {\ + echo sendmail_path = "/usr/sbin/sendmail -t -i" ;\ + } > /usr/local/etc/php/conf.d/sendmail.ini; \ + \ + echo 'apc.enable_cli=1' >> /usr/local/etc/php/conf.d/docker-php-ext-apcu.ini; \ + \ + echo 'memory_limit=512M' > /usr/local/etc/php/conf.d/memory-limit.ini; \ + \ + mkdir /var/www/data; \ + chown -R www-data:root /var/www; \ chmod -R g=u /var/www VOLUME /var/www/html -WORKDIR /var/www/html -RUN {\ - echo sendmail_path = "/usr/sbin/sendmail -t -i" ;\ - } > /usr/local/etc/php/conf.d/sendmail.ini; - COPY *.sh upgrade.exclude / RUN chmod +x /*.sh diff --git a/2019.06-rc/fpm-alpine/entrypoint.sh b/2019.06-rc/fpm-alpine/entrypoint.sh index 2d0bcf2..26fe25a 100644 --- a/2019.06-rc/fpm-alpine/entrypoint.sh +++ b/2019.06-rc/fpm-alpine/entrypoint.sh @@ -141,8 +141,7 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ]; then if [ -n "${MYSQL_DATABASE+x}" ] && [ -n "${MYSQL_PASSWORD+x}" ] && [ -n "${MYSQL_HOST+x}" ] && [ -n "${MYSQL_USER+x}" -o -n "${MYSQL_USERNAME+x}" ] && [ -n ${FRIENDICA_ADMIN_MAIL+x} ]; then echo "Installation with environment variables" - # TODO Bug in PHP Path for automatic installation - #FRIENDICA_PHP_PATH=${FRIENDICA_PHP_PATH:-/usr/local/php} + FRIENDICA_PHP_PATH=${FRIENDICA_PHP_PATH:-/usr/local/php} FRIENDICA_TZ=${FRIENDICA_TZ:-America/LosAngeles} FRIENDICA_LANG=${FRIENDICA_LANG:-en} MYSQL_PORT=${MYSQL_PORT:-3306} diff --git a/2019.06-rc/fpm/Dockerfile b/2019.06-rc/fpm/Dockerfile index f02a58c..17db261 100644 --- a/2019.06-rc/fpm/Dockerfile +++ b/2019.06-rc/fpm/Dockerfile @@ -1,5 +1,5 @@ # DO NOT EDIT: created by update.sh from Dockerfile-debian.template -FROM php:7.1-fpm +FROM php:7.3-fpm-stretch LABEL maintainer="Philipp Holzer " # entrypoint.sh and cron.sh dependencies @@ -34,8 +34,6 @@ RUN set -ex; \ libpng-dev \ libjpeg62-turbo-dev \ libtool \ - libmcrypt4 \ - libmcrypt-dev \ imagemagick \ libmagick++-dev \ libmemcached-dev \ @@ -45,29 +43,43 @@ RUN set -ex; \ librsvg2-2 \ libcurl4-openssl-dev \ curl \ + libzip-dev \ ; \ \ debMultiarch="$(dpkg-architecture --query DEB_BUILD_MULTIARCH)"; \ - pecl install imagick-3.4.3; \ - docker-php-ext-enable imagick; \ - pecl clear-cache \ - ; \ + \ docker-php-ext-configure gd \ --with-gd \ - --enable-gd-native-ttf \ --with-freetype-dir=/usr/include/ \ --with-png-dir=/usr/include/ \ --with-jpeg-dir=/usr/include/ \ ; \ - docker-php-ext-install -j 4 curl pdo pdo_mysql xml gd zip opcache mbstring posix ctype json iconv mcrypt \ + docker-php-ext-install -j 4 \ + curl \ + pdo \ + pdo_mysql \ + xml \ + gd \ + zip \ + opcache \ + mbstring \ + posix \ + ctype \ + json \ + iconv \ ; \ + \ # pecl will claim success even if one install fails, so we need to perform each install separately - pecl install memcached-3.0.4; \ - pecl install redis-3.1.6; \ + pecl install apcu-5.1.17; \ + pecl install memcached-3.1.3; \ + pecl install redis-4.3.0; \ + pecl install imagick-3.4.4; \ \ docker-php-ext-enable \ + apcu \ memcached \ redis \ + imagick \ ; \ \ # reset apt-mark's "manual" list so that "purge --auto-remove" will remove all build dependencies @@ -84,17 +96,21 @@ RUN set -ex; \ apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \ rm -rf /var/lib/apt/lists/* -RUN chown -R www-data:root /var/www; \ +RUN {\ + echo sendmail_path = "/usr/sbin/sendmail -t -i" ;\ + } > /usr/local/etc/php/conf.d/sendmail.ini; \ + \ + echo 'apc.enable_cli=1' >> /usr/local/etc/php/conf.d/docker-php-ext-apcu.ini; \ + \ + echo 'memory_limit=512M' > /usr/local/etc/php/conf.d/memory-limit.ini; \ + \ + mkdir /var/www/data; \ + chown -R www-data:root /var/www; \ chmod -R g=u /var/www VOLUME /var/www/html -WORKDIR /var/www/html -RUN {\ - echo sendmail_path = "/usr/sbin/sendmail -t -i" ;\ - } > /usr/local/etc/php/conf.d/sendmail.ini; - COPY *.sh upgrade.exclude / RUN chmod +x /*.sh diff --git a/2019.06-rc/fpm/entrypoint.sh b/2019.06-rc/fpm/entrypoint.sh index 2d0bcf2..26fe25a 100644 --- a/2019.06-rc/fpm/entrypoint.sh +++ b/2019.06-rc/fpm/entrypoint.sh @@ -141,8 +141,7 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ]; then if [ -n "${MYSQL_DATABASE+x}" ] && [ -n "${MYSQL_PASSWORD+x}" ] && [ -n "${MYSQL_HOST+x}" ] && [ -n "${MYSQL_USER+x}" -o -n "${MYSQL_USERNAME+x}" ] && [ -n ${FRIENDICA_ADMIN_MAIL+x} ]; then echo "Installation with environment variables" - # TODO Bug in PHP Path for automatic installation - #FRIENDICA_PHP_PATH=${FRIENDICA_PHP_PATH:-/usr/local/php} + FRIENDICA_PHP_PATH=${FRIENDICA_PHP_PATH:-/usr/local/php} FRIENDICA_TZ=${FRIENDICA_TZ:-America/LosAngeles} FRIENDICA_LANG=${FRIENDICA_LANG:-en} MYSQL_PORT=${MYSQL_PORT:-3306} diff --git a/Dockerfile-alpine.template b/Dockerfile-alpine.template index f1cfe2f..b647dcd 100644 --- a/Dockerfile-alpine.template +++ b/Dockerfile-alpine.template @@ -28,8 +28,6 @@ RUN set -ex; \ imagemagick-dev \ imagemagick \ libtool \ - libmcrypt \ - libmcrypt-dev \ libmemcached-dev \ cyrus-sasl-dev \ freetype \ @@ -43,26 +41,42 @@ RUN set -ex; \ rsync \ bzip2 \ pcre-dev \ + libzip-dev \ ; \ - pecl install imagick-%%IMAGICK_VERSION%%; \ - docker-php-ext-enable imagick; \ - pecl clear-cache; \ + \ docker-php-ext-configure gd \ --with-gd \ - --enable-gd-native-ttf \ --with-freetype-dir=/usr/include/ \ --with-png-dir=/usr/include/ \ --with-jpeg-dir=/usr/include/ \ ; \ - docker-php-ext-install -j 4 curl pdo pdo_mysql xml gd zip opcache mbstring posix ctype json iconv mcrypt; \ + \ + docker-php-ext-install -j 4 \ + curl \ + pdo \ + pdo_mysql \ + xml \ + gd \ + zip \ + opcache \ + mbstring \ + posix \ + ctype \ + json \ + iconv \ + ; \ \ # pecl will claim success even if one install fails, so we need to perform each install separately + pecl install APCu-%%APCU_VERSION%%; \ pecl install memcached-%%MEMCACHED_VERSION%%; \ pecl install redis-%%REDIS_VERSION%%; \ + pecl install imagick-%%IMAGICK_VERSION%%; \ \ docker-php-ext-enable \ + apcu \ memcached \ redis \ + imagick \ ; \ \ runDeps="$( \ @@ -74,17 +88,21 @@ RUN set -ex; \ apk add --virtual .friendica-phpext-rundeps $runDeps; \ apk del .build-deps; -RUN chown -R www-data:www-data /var/www; \ +RUN {\ + echo sendmail_path = "/usr/sbin/sendmail -t -i" ;\ + } > /usr/local/etc/php/conf.d/sendmail.ini; \ + \ + echo 'apc.enable_cli=1' >> /usr/local/etc/php/conf.d/docker-php-ext-apcu.ini; \ + \ + echo 'memory_limit=512M' > /usr/local/etc/php/conf.d/memory-limit.ini; \ + \ + mkdir /var/www/data; \ + chown -R www-data:root /var/www; \ chmod -R g=u /var/www VOLUME /var/www/html -WORKDIR /var/www/html %%VARIANT_EXTRAS%% -RUN {\ - echo sendmail_path = "/usr/sbin/sendmail -t -i" ;\ - } > /usr/local/etc/php/conf.d/sendmail.ini; - COPY *.sh upgrade.exclude / RUN chmod +x /*.sh diff --git a/Dockerfile-debian.template b/Dockerfile-debian.template index a27da27..919c06a 100644 --- a/Dockerfile-debian.template +++ b/Dockerfile-debian.template @@ -1,4 +1,4 @@ -FROM php:%%PHP_VERSION%%-%%VARIANT%% +FROM php:%%PHP_VERSION%%-%%VARIANT%%-stretch LABEL maintainer="Philipp Holzer " # entrypoint.sh and cron.sh dependencies @@ -33,8 +33,6 @@ RUN set -ex; \ libpng-dev \ libjpeg62-turbo-dev \ libtool \ - libmcrypt4 \ - libmcrypt-dev \ imagemagick \ libmagick++-dev \ libmemcached-dev \ @@ -44,29 +42,43 @@ RUN set -ex; \ librsvg2-2 \ libcurl4-openssl-dev \ curl \ + libzip-dev \ ; \ \ debMultiarch="$(dpkg-architecture --query DEB_BUILD_MULTIARCH)"; \ - pecl install imagick-%%IMAGICK_VERSION%%; \ - docker-php-ext-enable imagick; \ - pecl clear-cache \ - ; \ + \ docker-php-ext-configure gd \ --with-gd \ - --enable-gd-native-ttf \ --with-freetype-dir=/usr/include/ \ --with-png-dir=/usr/include/ \ --with-jpeg-dir=/usr/include/ \ ; \ - docker-php-ext-install -j 4 curl pdo pdo_mysql xml gd zip opcache mbstring posix ctype json iconv mcrypt \ + docker-php-ext-install -j 4 \ + curl \ + pdo \ + pdo_mysql \ + xml \ + gd \ + zip \ + opcache \ + mbstring \ + posix \ + ctype \ + json \ + iconv \ ; \ + \ # pecl will claim success even if one install fails, so we need to perform each install separately + pecl install apcu-%%APCU_VERSION%%; \ pecl install memcached-%%MEMCACHED_VERSION%%; \ pecl install redis-%%REDIS_VERSION%%; \ + pecl install imagick-%%IMAGICK_VERSION%%; \ \ docker-php-ext-enable \ + apcu \ memcached \ redis \ + imagick \ ; \ \ # reset apt-mark's "manual" list so that "purge --auto-remove" will remove all build dependencies @@ -83,17 +95,21 @@ RUN set -ex; \ apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \ rm -rf /var/lib/apt/lists/* -RUN chown -R www-data:root /var/www; \ +RUN {\ + echo sendmail_path = "/usr/sbin/sendmail -t -i" ;\ + } > /usr/local/etc/php/conf.d/sendmail.ini; \ + \ + echo 'apc.enable_cli=1' >> /usr/local/etc/php/conf.d/docker-php-ext-apcu.ini; \ + \ + echo 'memory_limit=512M' > /usr/local/etc/php/conf.d/memory-limit.ini; \ + \ + mkdir /var/www/data; \ + chown -R www-data:root /var/www; \ chmod -R g=u /var/www VOLUME /var/www/html -WORKDIR /var/www/html %%VARIANT_EXTRAS%% -RUN {\ - echo sendmail_path = "/usr/sbin/sendmail -t -i" ;\ - } > /usr/local/etc/php/conf.d/sendmail.ini; - COPY *.sh upgrade.exclude / RUN chmod +x /*.sh diff --git a/update.sh b/update.sh index b1b15e3..5198ed2 100755 --- a/update.sh +++ b/update.sh @@ -2,7 +2,7 @@ set -eo pipefail declare -A php_version=( - [default]='7.1' + [default]='7.3' ) declare -A cmd=( @@ -23,14 +23,51 @@ declare -A extras=( [fpm-alpine]='' ) +apcu_version="$( + git ls-remote --tags https://github.com/krakjoe/apcu.git \ + | cut -d/ -f3 \ + | grep -vE -- '-rc|-b' \ + | sed -E 's/^v//' \ + | sort -V \ + | tail -1 +)" + +memcached_version="$( + git ls-remote --tags https://github.com/php-memcached-dev/php-memcached.git \ + | cut -d/ -f3 \ + | grep -vE -- '-rc|-b' \ + | sed -E 's/^[rv]//' \ + | sort -V \ + | tail -1 +)" + +redis_version="$( + git ls-remote --tags https://github.com/phpredis/phpredis.git \ + | cut -d/ -f3 \ + | grep -viE '[a-z]' \ + | tr -d '^{}' \ + | sort -V \ + | tail -1 +)" + +imagick_version="$( + git ls-remote --tags https://github.com/mkoppanen/imagick.git \ + | cut -d/ -f3 \ + | grep -viE '[a-z]' \ + | tr -d '^{}' \ + | sort -V \ + | tail -1 +)" + declare -A pecl_versions=( - [Imagick]='3.4.3' - [memcached]='3.0.4' - [redis]='3.1.6' + [APCu]="$apcu_version" + [memcached]="$memcached_version" + [redis]="$redis_version" + [imagick]="$imagick_version" ) declare -A install_extras=( - ['stable']='\nRUN set -ex; \\\n curl -fsSL -o friendica.tar.gz \\\n "https://github.com/friendica/friendica/archive/${FRIENDICA_VERSION}.tar.gz"; \\\n tar -xzf friendica.tar.gz -C /usr/src/; \\\n rm friendica.tar.gz; \\\n mv -f /usr/src/friendica-${FRIENDICA_VERSION}/ /usr/src/friendica; \\\n chmod 777 /usr/src/friendica/view/smarty3; \\\n curl -fsSL -o friendica_addons.tar.gz \\\n "https://github.com/friendica/friendica-addons/archive/${FRIENDICA_ADDONS}.tar.gz"; \\\n mkdir /usr/src/friendica/addon; \\\n tar -xzf friendica_addons.tar.gz -C /usr/src/friendica/addon --strip-components=1; \\\n rm friendica_addons.tar.gz; \\\n /usr/src/friendica/bin/composer.phar install --no-dev -d /usr/src/friendica;' + ['stable']='\nRUN set -ex; \\\n curl -fsSL -o friendica.tar.gz \\\n "https://github.com/friendica/friendica/archive/${FRIENDICA_VERSION}.tar.gz"; \\\n tar -xzf friendica.tar.gz -C /usr/src/; \\\n rm friendica.tar.gz; \\\n mv -f /usr/src/friendica-${FRIENDICA_VERSION}/ /usr/src/friendica; \\\n chmod 777 /usr/src/friendica/view/smarty3; \\\n curl -fsSL -o friendica_addons.tar.gz \\\n "https://github.com/friendica/friendica-addons/archive/${FRIENDICA_ADDONS}.tar.gz"; \\\n mkdir -p /usr/src/friendica/proxy; \\\n mkdir -p /usr/src/friendica/addon; \\\n tar -xzf friendica_addons.tar.gz -C /usr/src/friendica/addon --strip-components=1; \\\n rm friendica_addons.tar.gz; \\\n /usr/src/friendica/bin/composer.phar install --no-dev -d /usr/src/friendica;' ['develop']='' ) @@ -76,7 +113,8 @@ function create_variant() { s/%%CMD%%/'"${cmd[$variant]}"'/g; s|%%VARIANT_EXTRAS%%|'"${extras[$variant]}"'|g; s|%%INSTALL_EXTRAS%%|'"${install_extras[$install_type]}"'|g; - s/%%IMAGICK_VERSION%%/'"${pecl_versions[Imagick]}"'/g; + s/%%APCU_VERSION%%/'"${pecl_versions[APCu]}"'/g; + s/%%IMAGICK_VERSION%%/'"${pecl_versions[imagick]}"'/g; s/%%MEMCACHED_VERSION%%/'"${pecl_versions[memcached]}"'/g; s/%%REDIS_VERSION%%/'"${pecl_versions[redis]}"'/g; ' "$dir/Dockerfile"