From d5647295ca5b5c627b06d7384335d83c698290fd Mon Sep 17 00:00:00 2001 From: Lan Phan Date: Sat, 9 Feb 2019 15:34:34 +0700 Subject: [PATCH] add MYSQL_CLIENT and AMQP for php-worker (#1949) --- docker-compose.yml | 2 ++ env-example | 2 ++ php-worker/Dockerfile | 20 ++++++++++++++++++-- 3 files changed, 22 insertions(+), 2 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index df11146b..bcc27631 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -191,6 +191,8 @@ services: - INSTALL_PHALCON=${PHP_WORKER_INSTALL_PHALCON} - INSTALL_SOAP=${PHP_WORKER_INSTALL_SOAP} - INSTALL_ZIP_ARCHIVE=${PHP_WORKER_INSTALL_ZIP_ARCHIVE} + - INSTALL_MYSQL_CLIENT=${PHP_WORKER_INSTALL_MYSQL_CLIENT} + - INSTALL_AMQP=${PHP_WORKER_INSTALL_AMQP} - PUID=${PHP_WORKER_PUID} - PGID=${PHP_WORKER_PGID} volumes: diff --git a/env-example b/env-example index 3d6cdf38..ca17871f 100644 --- a/env-example +++ b/env-example @@ -173,6 +173,8 @@ PHP_WORKER_INSTALL_BCMATH=false PHP_WORKER_INSTALL_PHALCON=false PHP_WORKER_INSTALL_SOAP=false PHP_WORKER_INSTALL_ZIP_ARCHIVE=false +PHP_WORKER_INSTALL_MYSQL_CLIENT=false +PHP_WORKER_INSTALL_AMQP=false PHP_WORKER_PUID=1000 PHP_WORKER_PGID=1000 diff --git a/php-worker/Dockerfile b/php-worker/Dockerfile index 590159bc..25bcf83f 100644 --- a/php-worker/Dockerfile +++ b/php-worker/Dockerfile @@ -63,8 +63,21 @@ RUN if [ ${INSTALL_ZIP_ARCHIVE} = true ]; then \ docker-php-ext-install zip \ ;fi -RUN rm /var/cache/apk/* \ - && mkdir -p /var/www +# Install MySQL Client: +ARG INSTALL_MYSQL_CLIENT=false +RUN if [ ${INSTALL_MYSQL_CLIENT} = true ]; then \ + apk --update add mysql-client \ +;fi + +# Install AMQP: +ARG INSTALL_AMQP=false + +RUN if [ ${INSTALL_AMQP} = true ]; then \ + apk --update add rabbitmq-c rabbitmq-c-dev && \ + pecl install amqp && \ + docker-php-ext-enable amqp && \ + docker-php-ext-install sockets \ +;fi # Install Phalcon ext ARG INSTALL_PHALCON=false @@ -80,6 +93,9 @@ RUN if [ $INSTALL_PHALCON = true ]; then \ && rm -rf /tmp/cphalcon* \ ;fi +RUN rm /var/cache/apk/* \ + && mkdir -p /var/www + # #-------------------------------------------------------------------------- # Optional Supervisord Configuration