From f8ec06ac1cd32aee0f5083fe847b6b510c04fa02 Mon Sep 17 00:00:00 2001 From: anribras Date: Sat, 6 Jul 2019 17:41:11 +0800 Subject: [PATCH 1/3] Add mariadb timezone setting via WORKSPACE_TIMEZONE in .env --- docker-compose.yml | 1 + mariadb/Dockerfile | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/docker-compose.yml b/docker-compose.yml index a136f74..49a4c3a 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -407,6 +407,7 @@ services: ports: - "${MARIADB_PORT}:3306" environment: + - TZ=${WORKSPACE_TIMEZONE} - MYSQL_DATABASE=${MARIADB_DATABASE} - MYSQL_USER=${MARIADB_USER} - MYSQL_PASSWORD=${MARIADB_PASSWORD} diff --git a/mariadb/Dockerfile b/mariadb/Dockerfile index 0dcb948..7538b4e 100644 --- a/mariadb/Dockerfile +++ b/mariadb/Dockerfile @@ -2,6 +2,13 @@ FROM mariadb:latest LABEL maintainer="Mahmoud Zalt " +##################################### +# Set Timezone +##################################### + +ARG TZ=UTC +ENV TZ ${TZ} +RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone && chown -R mysql:root /var/lib/mysql/ COPY my.cnf /etc/mysql/conf.d/my.cnf CMD ["mysqld"] From 247ce67097066fe9126512b9ac585729abfe1233 Mon Sep 17 00:00:00 2001 From: Pavel Savushkin Date: Fri, 12 Mar 2021 02:00:10 +0200 Subject: [PATCH 2/3] fix(AST extension): bump version due to php 8.0 support According to the changelog of the extension version should be bumped to support PHP 8.0 Closes 2859 --- env-example | 2 +- workspace/Dockerfile | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/env-example b/env-example index cf64e75..6a8d9ef 100644 --- a/env-example +++ b/env-example @@ -185,7 +185,7 @@ WORKSPACE_INSTALL_AUDIOWAVEFORM=false WORKSPACE_INSTALL_WKHTMLTOPDF=false WORKSPACE_INSTALL_GNU_PARALLEL=false WORKSPACE_INSTALL_AST=true -WORKSPACE_AST_VERSION=1.0.3 +WORKSPACE_AST_VERSION=1.0.10 WORKSPACE_BROWSERSYNC_HOST_PORT=3000 WORKSPACE_BROWSERSYNC_UI_HOST_PORT=3001 WORKSPACE_VUE_CLI_SERVE_HOST_PORT=8080 diff --git a/workspace/Dockerfile b/workspace/Dockerfile index c6c5105..23b196e 100644 --- a/workspace/Dockerfile +++ b/workspace/Dockerfile @@ -635,7 +635,7 @@ RUN if [ ${INSTALL_INOTIFY} = true ]; then \ ########################################################################### ARG INSTALL_AST=false -ARG AST_VERSION=1.0.3 +ARG AST_VERSION=1.0.10 ENV AST_VERSION ${AST_VERSION} RUN if [ ${INSTALL_AST} = true ]; then \ @@ -1428,7 +1428,7 @@ RUN if [ ${INSTALL_WKHTMLTOPDF} = true ]; then \ libx11-dev \ libjpeg62 \ libxtst6 \ - fontconfig \ + fontconfig \ libjpeg-turbo8-dev \ xfonts-base \ xfonts-75dpi \ From 67cc72da622fa340ff24971b2f7e496e5ca91bad Mon Sep 17 00:00:00 2001 From: Pavel Savushkin Date: Fri, 12 Mar 2021 03:20:32 +0200 Subject: [PATCH 3/3] fix(IMAGEMAGICK extension): implement building extension for PHP 8.0 from source We need to build imagemagick extension from sources due the latest version, that supports PHP 8.0 has not been released to PECL. Closes #2861 --- docker-compose.yml | 8 ++++++-- env-example | 4 ++++ laravel-horizon/Dockerfile | 20 +++++++++++++++++++- php-fpm/Dockerfile | 24 +++++++++++++++++++++--- php-worker/Dockerfile | 30 +++++++++++++++++++++++++----- workspace/Dockerfile | 25 +++++++++++++++++++++++-- 6 files changed, 98 insertions(+), 13 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index 37b597d..e3a247c 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -93,7 +93,7 @@ services: - NVM_NODEJS_ORG_MIRROR=${WORKSPACE_NVM_NODEJS_ORG_MIRROR} - INSTALL_NODE=${WORKSPACE_INSTALL_NODE} - NPM_REGISTRY=${WORKSPACE_NPM_REGISTRY} - - NPM_FETCH_RETRIES=${WORKSPACE_NPM_FETCH_RETRIES} + - NPM_FETCH_RETRIES=${WORKSPACE_NPM_FETCH_RETRIES} - NPM_FETCH_RETRY_FACTOR=${WORKSPACE_NPM_FETCH_RETRY_FACTOR} - NPM_FETCH_RETRY_MINTIMEOUT=${WORKSPACE_NPM_FETCH_RETRY_MINTIMEOUT} - NPM_FETCH_RETRY_MAXTIMEOUT=${WORKSPACE_NPM_FETCH_RETRY_MAXTIMEOUT} @@ -152,6 +152,7 @@ services: - YARN_VERSION=${WORKSPACE_YARN_VERSION} - DRUSH_VERSION=${WORKSPACE_DRUSH_VERSION} - AST_VERSION=${WORKSPACE_AST_VERSION} + - IMAGEMAGICK_VERSION=${WORKSPACE_IMAGEMAGICK_VERSION} - TZ=${WORKSPACE_TIMEZONE} - BLACKFIRE_CLIENT_ID=${BLACKFIRE_CLIENT_ID} - BLACKFIRE_CLIENT_TOKEN=${BLACKFIRE_CLIENT_TOKEN} @@ -261,6 +262,7 @@ services: - DOWNGRADE_OPENSSL_TLS_AND_SECLEVEL=${PHP_DOWNGRADE_OPENSSL_TLS_AND_SECLEVEL} - PUID=${PHP_FPM_PUID} - PGID=${PHP_FPM_PGID} + - IMAGEMAGICK_VERSION=${PHP_FPM_IMAGEMAGICK_VERSION} - LOCALE=${PHP_FPM_DEFAULT_LOCALE} - PHP_FPM_NEW_RELIC=${PHP_FPM_NEW_RELIC} - PHP_FPM_NEW_RELIC_KEY=${PHP_FPM_NEW_RELIC_KEY} @@ -325,6 +327,7 @@ services: - INSTALL_XMLRPC=${PHP_WORKER_INSTALL_XMLRPC} - PUID=${PHP_WORKER_PUID} - PGID=${PHP_WORKER_PGID} + - IMAGEMAGICK_VERSION=${PHP_WORKER_IMAGEMAGICK_VERSION} volumes: - ${APP_CODE_PATH_HOST}:${APP_CODE_PATH_CONTAINER}${APP_CODE_CONTAINER_FLAG} - ./php-worker/supervisord.d:/etc/supervisord.d @@ -358,6 +361,7 @@ services: - INSTALL_AUDIOWAVEFORM=${LARAVEL_HORIZON_INSTALL_AUDIOWAVEFORM} - PUID=${LARAVEL_HORIZON_PUID} - PGID=${LARAVEL_HORIZON_PGID} + - IMAGEMAGICK_VERSION=${LARAVEL_HORIZON_IMAGEMAGICK_VERSION} volumes: - ${APP_CODE_PATH_HOST}:${APP_CODE_PATH_CONTAINER} - ./laravel-horizon/supervisord.d:/etc/supervisord.d @@ -1892,7 +1896,7 @@ services: - "3000:3000" container_name: react stdin_open: true - environment: + environment: - CHOKIDAR_USEPOLLING=true networks: - frontend diff --git a/env-example b/env-example index cf64e75..54a60e9 100644 --- a/env-example +++ b/env-example @@ -157,6 +157,7 @@ WORKSPACE_INSTALL_POWERLINE=false WORKSPACE_INSTALL_SUPERVISOR=false WORKSPACE_INSTALL_IMAGE_OPTIMIZERS=false WORKSPACE_INSTALL_IMAGEMAGICK=false +WORKSPACE_IMAGEMAGICK_VERSION=latest WORKSPACE_INSTALL_TERRAFORM=false WORKSPACE_INSTALL_DUSK_DEPS=false WORKSPACE_INSTALL_PG_CLIENT=false @@ -204,6 +205,7 @@ PHP_FPM_INSTALL_BCMATH=true PHP_FPM_INSTALL_MYSQLI=true PHP_FPM_INSTALL_INTL=true PHP_FPM_INSTALL_IMAGEMAGICK=true +PHP_FPM_IMAGEMAGICK_VERSION=latest PHP_FPM_INSTALL_OPCACHE=true PHP_FPM_INSTALL_IMAGE_OPTIMIZERS=true PHP_FPM_INSTALL_PHPREDIS=true @@ -272,6 +274,7 @@ PHP_FPM_NEW_RELIC_APP_NAME=app_name PHP_WORKER_INSTALL_BZ2=false PHP_WORKER_INSTALL_GD=false PHP_WORKER_INSTALL_IMAGEMAGICK=false +PHP_WORKER_IMAGEMAGICK_VERSION=latest PHP_WORKER_INSTALL_GMP=false PHP_WORKER_INSTALL_PGSQL=false PHP_WORKER_INSTALL_BCMATH=false @@ -312,6 +315,7 @@ LARAVEL_HORIZON_INSTALL_BZ2=false LARAVEL_HORIZON_INSTALL_GD=false LARAVEL_HORIZON_INSTALL_GMP=false LARAVEL_HORIZON_INSTALL_IMAGEMAGICK=false +LARAVEL_HORIZON_IMAGEMAGICK_VERSION=latest LARAVEL_HORIZON_INSTALL_SOCKETS=false LARAVEL_HORIZON_INSTALL_YAML=false LARAVEL_HORIZON_INSTALL_ZIP_ARCHIVE=false diff --git a/laravel-horizon/Dockerfile b/laravel-horizon/Dockerfile index 0066910..a05137e 100644 --- a/laravel-horizon/Dockerfile +++ b/laravel-horizon/Dockerfile @@ -74,10 +74,28 @@ RUN if [ ${INSTALL_GMP} = true ]; then \ #Install ImageMagick package: ARG INSTALL_IMAGEMAGICK=false +ARG IMAGEMAGICK_VERSION=latest +ENV IMAGEMAGICK_VERSION ${IMAGEMAGICK_VERSION} RUN set -eux; \ if [ ${INSTALL_IMAGEMAGICK} = true ]; then \ apk add --update --no-cache imagemagick-dev; \ - pecl install imagick; \ + if [ $(php -r "echo PHP_MAJOR_VERSION;") = "8" ]; then \ + apk add --update --no-cache git && \ + cd /tmp && \ + if [ ${IMAGEMAGICK_VERSION} = "latest" ]; then \ + git clone https://github.com/Imagick/imagick; \ + else \ + git clone --branch ${IMAGEMAGICK_VERSION} https://github.com/Imagick/imagick; \ + fi && \ + cd imagick && \ + phpize && \ + ./configure && \ + make && \ + make install && \ + rm -r /tmp/imagick; \ + else \ + pecl install imagick; \ + fi && \ docker-php-ext-enable imagick; \ php -m | grep -q 'imagick'; \ fi diff --git a/php-fpm/Dockerfile b/php-fpm/Dockerfile index a1e7051..2d8d67e 100644 --- a/php-fpm/Dockerfile +++ b/php-fpm/Dockerfile @@ -343,7 +343,7 @@ RUN if [ ${INSTALL_XHPROF} = true ]; then \ # Install the php xhprof extension if [ $(php -r "echo PHP_MAJOR_VERSION;") = 7 ]; then \ curl -L -o /tmp/xhprof.tar.gz "https://github.com/tideways/php-xhprof-extension/archive/v5.0.1.tar.gz"; \ - else \ + else \ curl -L -o /tmp/xhprof.tar.gz "https://codeload.github.com/phacility/xhprof/tar.gz/master"; \ fi \ && mkdir -p xhprof \ @@ -684,10 +684,28 @@ RUN if [ ${INSTALL_IMAGE_OPTIMIZERS} = true ]; then \ USER root ARG INSTALL_IMAGEMAGICK=false +ARG IMAGEMAGICK_VERSION=latest +ENV IMAGEMAGICK_VERSION ${IMAGEMAGICK_VERSION} RUN if [ ${INSTALL_IMAGEMAGICK} = true ]; then \ apt-get install -y libmagickwand-dev imagemagick && \ - pecl install imagick && \ + if [ $(php -r "echo PHP_MAJOR_VERSION;") = "8" ]; then \ + apt-get install -y git && \ + cd /tmp && \ + if [ ${IMAGEMAGICK_VERSION} = "latest" ]; then \ + git clone https://github.com/Imagick/imagick; \ + else \ + git clone --branch ${IMAGEMAGICK_VERSION} https://github.com/Imagick/imagick; \ + fi && \ + cd imagick && \ + phpize && \ + ./configure && \ + make && \ + make install && \ + rm -r /tmp/imagick; \ + else \ + pecl install imagick; \ + fi && \ docker-php-ext-enable imagick \ ;fi @@ -928,7 +946,7 @@ RUN if [ ${INSTALL_WKHTMLTOPDF} = true ]; then \ libx11-dev \ libjpeg62 \ libxtst6 \ - fontconfig \ + fontconfig \ libjpeg62-turbo \ xfonts-base \ xfonts-75dpi \ diff --git a/php-worker/Dockerfile b/php-worker/Dockerfile index 64f0829..dcc8245 100644 --- a/php-worker/Dockerfile +++ b/php-worker/Dockerfile @@ -69,11 +69,31 @@ RUN if [ ${INSTALL_GD} = true ]; then \ #Install ImageMagick: ARG INSTALL_IMAGEMAGICK=false -RUN if [ ${INSTALL_IMAGEMAGICK} = true ]; then \ - apk add --update imagemagick-dev imagemagick; \ - pecl install imagick; \ - docker-php-ext-enable imagick \ -;fi +ARG IMAGEMAGICK_VERSION=latest +ENV IMAGEMAGICK_VERSION ${IMAGEMAGICK_VERSION} +RUN set -eux; \ + if [ ${INSTALL_IMAGEMAGICK} = true ]; then \ + apk add --update --no-cache imagemagick-dev; \ + if [ $(php -r "echo PHP_MAJOR_VERSION;") = "8" ]; then \ + apk add --update --no-cache git && \ + cd /tmp && \ + if [ ${IMAGEMAGICK_VERSION} = "latest" ]; then \ + git clone https://github.com/Imagick/imagick; \ + else \ + git clone --branch ${IMAGEMAGICK_VERSION} https://github.com/Imagick/imagick; \ + fi && \ + cd imagick && \ + phpize && \ + ./configure && \ + make && \ + make install && \ + rm -r /tmp/imagick; \ + else \ + pecl install imagick; \ + fi && \ + docker-php-ext-enable imagick; \ + php -m | grep -q 'imagick'; \ + fi #Install GMP package: ARG INSTALL_GMP=false diff --git a/workspace/Dockerfile b/workspace/Dockerfile index c6c5105..9112664 100644 --- a/workspace/Dockerfile +++ b/workspace/Dockerfile @@ -1200,9 +1200,30 @@ USER laradock USER root ARG INSTALL_IMAGEMAGICK=false +ARG IMAGEMAGICK_VERSION=latest +ENV IMAGEMAGICK_VERSION ${IMAGEMAGICK_VERSION} RUN if [ ${INSTALL_IMAGEMAGICK} = true ]; then \ - apt-get install -y imagemagick php-imagick \ + apt-get install -y libmagickwand-dev imagemagick && \ + if [ $(php -r "echo PHP_MAJOR_VERSION;") = "8" ]; then \ + apt-get install -y git && \ + cd /tmp && \ + if [ ${IMAGEMAGICK_VERSION} = "latest" ]; then \ + git clone https://github.com/Imagick/imagick; \ + else \ + git clone --branch ${IMAGEMAGICK_VERSION} https://github.com/Imagick/imagick; \ + fi && \ + cd imagick && \ + phpize && \ + ./configure && \ + make && \ + make install && \ + rm -r /tmp/imagick; \ + else \ + pecl install imagick; \ + fi && \ + echo "extension=imagick.so" >> /etc/php/${LARADOCK_PHP_VERSION}/mods-available/imagick.ini && \ + ln -s /etc/php/${LARADOCK_PHP_VERSION}/mods-available/imagick.ini /etc/php/${LARADOCK_PHP_VERSION}/cli/conf.d/20-imagick.ini \ ;fi ########################################################################### @@ -1428,7 +1449,7 @@ RUN if [ ${INSTALL_WKHTMLTOPDF} = true ]; then \ libx11-dev \ libjpeg62 \ libxtst6 \ - fontconfig \ + fontconfig \ libjpeg-turbo8-dev \ xfonts-base \ xfonts-75dpi \