From 67c5a6a55209de49747a72ca4e3cde2e6a4e81db Mon Sep 17 00:00:00 2001 From: haoyq Date: Mon, 30 Sep 2019 17:10:56 +0800 Subject: [PATCH] php-worker install redis extension --- docker-compose.yml | 1 + env-example | 1 + php-worker/Dockerfile | 8 ++++++++ 3 files changed, 10 insertions(+) diff --git a/docker-compose.yml b/docker-compose.yml index 07c47f6..1bb6a70 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -231,6 +231,7 @@ services: - INSTALL_TAINT=${PHP_WORKER_INSTALL_TAINT} - INSTALL_FFMPEG=${PHP_WORKER_INSTALL_FFMPEG} - INSTALL_GMP=${PHP_WORKER_INSTALL_GMP} + - INSTALL_REDIS=${PHP_WORKER_INSTALL_REDIS} - PUID=${PHP_WORKER_PUID} - PGID=${PHP_WORKER_PGID} volumes: diff --git a/env-example b/env-example index 0fd9d9d..ad5a4e1 100644 --- a/env-example +++ b/env-example @@ -208,6 +208,7 @@ PHP_WORKER_INSTALL_TAINT=false PHP_WORKER_INSTALL_FFMPEG=false PHP_WORKER_INSTALL_GMP=false PHP_WORKER_INSTALL_CASSANDRA=false +PHP_WORKER_INSTALL_REDIS=false PHP_WORKER_PUID=1000 PHP_WORKER_PGID=1000 diff --git a/php-worker/Dockerfile b/php-worker/Dockerfile index b2e496f..855cd32 100644 --- a/php-worker/Dockerfile +++ b/php-worker/Dockerfile @@ -134,6 +134,14 @@ RUN if [ ${INSTALL_GMP} = true ]; then \ RUN rm /var/cache/apk/* \ && mkdir -p /var/www +# Install Redis package: +ARG INSTALL_REDIS=false +RUN if [ ${INSTALL_REDIS} = true ]; then \ + # Install Redis Extension + printf "\n" | pecl install -o -f redis \ + && rm -rf /tmp/pear \ + && docker-php-ext-enable redis \ +;fi ########################################################################### # Swoole EXTENSION