diff --git a/.env.example b/.env.example index 96338ac..d0ac818 100644 --- a/.env.example +++ b/.env.example @@ -203,6 +203,7 @@ WORKSPACE_INSTALL_SSDB=false WORKSPACE_INSTALL_TRADER=false WORKSPACE_PROTOC_VERSION=latest WORKSPACE_INSTALL_MEMCACHED=true +WORKSPACE_INSTALL_EVENT=false ### PHP_FPM ############################################### @@ -274,6 +275,7 @@ PHP_FPM_ADDITIONAL_LOCALES="en_US.UTF-8 es_ES.UTF-8 fr_FR.UTF-8" PHP_FPM_INSTALL_DOCKER_CLIENT=false PHP_FPM_DEFAULT_LOCALE=POSIX PHP_FPM_XDEBUG_PORT=9003 +PHP_FPM_INSTALL_EVENT=false PHP_FPM_PUID=1000 PHP_FPM_PGID=1000 @@ -317,6 +319,7 @@ PHP_WORKER_INSTALL_REDIS=false PHP_WORKER_INSTALL_IMAP=false PHP_WORKER_INSTALL_XMLRPC=false PHP_WORKER_INSTALL_SSDB=false +PHP_WORKER_INSTALL_EVENT=false PHP_WORKER_PUID=1000 PHP_WORKER_PGID=1000 diff --git a/docker-compose.yml b/docker-compose.yml index 43d2e51..7d99d88 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -172,6 +172,7 @@ services: - PROTOC_VERSION=${WORKSPACE_PROTOC_VERSION} - INSTALL_DOCKER_CLIENT=${WORKSPACE_INSTALL_DOCKER_CLIENT} - INSTALL_MEMCACHED=${WORKSPACE_INSTALL_MEMCACHED} + - INSTALL_EVENT=${WORKSPACE_INSTALL_EVENT} - http_proxy - https_proxy - no_proxy @@ -274,6 +275,7 @@ services: - INSTALL_ZOOKEEPER=${PHP_FPM_INSTALL_ZOOKEEPER} - INSTALL_SSDB=${PHP_FPM_INSTALL_SSDB} - INSTALL_TRADER=${PHP_FPM_INSTALL_TRADER} + - INSTALL_EVENT=${PHP_FPM_INSTALL_EVENT} - DOWNGRADE_OPENSSL_TLS_AND_SECLEVEL=${PHP_DOWNGRADE_OPENSSL_TLS_AND_SECLEVEL} - PUID=${PHP_FPM_PUID} - PGID=${PHP_FPM_PGID} @@ -347,6 +349,7 @@ services: - INSTALL_IMAP=${PHP_WORKER_INSTALL_IMAP} - INSTALL_XMLRPC=${PHP_WORKER_INSTALL_XMLRPC} - INSTALL_SSDB=${PHP_WORKER_INSTALL_SSDB} + - INSTALL_EVENT=${PHP_WORKER_INSTALL_EVENT} - PUID=${PHP_WORKER_PUID} - PGID=${PHP_WORKER_PGID} - IMAGEMAGICK_VERSION=${PHP_WORKER_IMAGEMAGICK_VERSION} diff --git a/php-fpm/Dockerfile b/php-fpm/Dockerfile index 57578eb..724097a 100644 --- a/php-fpm/Dockerfile +++ b/php-fpm/Dockerfile @@ -1236,6 +1236,38 @@ RUN if [ ${INSTALL_ZMQ} = true ]; then \ && echo "extension=zmq.so" > /usr/local/etc/php/conf.d/zmq.ini \ ;fi + +############################################################################ +## Event: +############################################################################ +USER root + +ARG INSTALL_EVENT=false + +RUN set -eux; \ + if [ ${INSTALL_EVENT} = true ]; then \ + curl -L -o /tmp/libevent.tar.gz https://github.com/libevent/libevent/releases/download/release-2.1.12-stable/libevent-2.1.12-stable.tar.gz &&\ + mkdir -p /tmp/libevent-php &&\ + tar -C /tmp/libevent-php -zxvf /tmp/libevent.tar.gz --strip 1 &&\ + cd /tmp/libevent-php &&\ + ./configure --prefix=/usr/local/libevent-2.1.12 &&\ + make &&\ + make install &&\ + rm /tmp/libevent.tar.gz &&\ + docker-php-ext-install sockets &&\ + curl -L -o /tmp/event.tar.gz http://pecl.php.net/get/event-3.0.6.tgz &&\ + mkdir -p /tmp/event-php &&\ + tar -C /tmp/event-php -zxvf /tmp/event.tar.gz --strip 1 &&\ + cd /tmp/event-php &&\ + phpize &&\ + ./configure --with-event-libevent-dir=/usr/local/libevent-2.1.12/ &&\ + make &&\ + make install &&\ + rm /tmp/event.tar.gz &&\ + docker-php-ext-enable event &&\ + php -m | grep -q 'event' \ +;fi + ########################################################################### # Check PHP version: ########################################################################### diff --git a/php-worker/Dockerfile b/php-worker/Dockerfile index 8be39f8..687ba90 100644 --- a/php-worker/Dockerfile +++ b/php-worker/Dockerfile @@ -508,6 +508,38 @@ RUN set -xe; \ && docker-php-ext-enable ssdb \ ;fi + +############################################################################ +## Event: +############################################################################ +USER root + +ARG INSTALL_EVENT=false + +RUN set -eux; \ + if [ ${INSTALL_EVENT} = true ]; then \ + curl -L -o /tmp/libevent.tar.gz https://github.com/libevent/libevent/releases/download/release-2.1.12-stable/libevent-2.1.12-stable.tar.gz &&\ + mkdir -p /tmp/libevent-php &&\ + tar -C /tmp/libevent-php -zxvf /tmp/libevent.tar.gz --strip 1 &&\ + cd /tmp/libevent-php &&\ + ./configure --prefix=/usr/local/libevent-2.1.12 &&\ + make &&\ + make install &&\ + rm /tmp/libevent.tar.gz &&\ + docker-php-ext-install sockets &&\ + curl -L -o /tmp/event.tar.gz http://pecl.php.net/get/event-3.0.6.tgz &&\ + mkdir -p /tmp/event-php &&\ + tar -C /tmp/event-php -zxvf /tmp/event.tar.gz --strip 1 &&\ + cd /tmp/event-php &&\ + phpize &&\ + ./configure --with-event-libevent-dir=/usr/local/libevent-2.1.12/ &&\ + make &&\ + make install &&\ + rm /tmp/event.tar.gz &&\ + docker-php-ext-enable event &&\ + php -m | grep -q 'event' \ +;fi + # #-------------------------------------------------------------------------- # Optional Supervisord Configuration diff --git a/workspace/Dockerfile b/workspace/Dockerfile index 8cf3452..7458f52 100644 --- a/workspace/Dockerfile +++ b/workspace/Dockerfile @@ -1738,6 +1738,41 @@ RUN if [ ${INSTALL_ZMQ} = true ]; then \ && ln -s /etc/php/${LARADOCK_PHP_VERSION}/mods-available/zmq.ini /etc/php/${LARADOCK_PHP_VERSION}/cli/conf.d/20-zmq.ini \ ;fi +############################################################################ +## Event: +############################################################################ +USER root + +ARG INSTALL_EVENT=false + +RUN set -eux; \ + if [ ${INSTALL_EVENT} = true ]; then \ + curl -L -o /tmp/libevent.tar.gz https://github.com/libevent/libevent/releases/download/release-2.1.12-stable/libevent-2.1.12-stable.tar.gz &&\ + mkdir -p /tmp/libevent-php &&\ + tar -C /tmp/libevent-php -zxvf /tmp/libevent.tar.gz --strip 1 &&\ + cd /tmp/libevent-php &&\ + ./configure --prefix=/usr/local/libevent-2.1.12 &&\ + make &&\ + make install &&\ + rm /tmp/libevent.tar.gz &&\ + echo "extension=sockets.so" >> /etc/php/${LARADOCK_PHP_VERSION}/mods-available/sockets.ini && \ + ln -s /etc/php/${LARADOCK_PHP_VERSION}/mods-available/sockets.ini /etc/php/${LARADOCK_PHP_VERSION}/cli/conf.d/20-sockets.ini && \ + curl -L -o /tmp/event.tar.gz http://pecl.php.net/get/event-3.0.6.tgz &&\ + mkdir -p /tmp/event-php &&\ + tar -C /tmp/event-php -zxvf /tmp/event.tar.gz --strip 1 &&\ + cd /tmp/event-php &&\ + phpize &&\ + ./configure --with-event-libevent-dir=/usr/local/libevent-2.1.12/ &&\ + make &&\ + make install &&\ + rm /tmp/event.tar.gz &&\ + echo "extension=event.so" >> /etc/php/${LARADOCK_PHP_VERSION}/mods-available/event.ini && \ + ln -s /etc/php/${LARADOCK_PHP_VERSION}/mods-available/event.ini /etc/php/${LARADOCK_PHP_VERSION}/cli/conf.d/20-event.ini && \ + php -m | grep -q 'event' \ +;fi + + + # #-------------------------------------------------------------------------- # Final Touch