Skip to content

Commit 67c5a6a

Browse files
author
haoyq
committed
php-worker install redis extension
1 parent 861ea6b commit 67c5a6a

3 files changed

Lines changed: 10 additions & 0 deletions

File tree

docker-compose.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -231,6 +231,7 @@ services:
231231
- INSTALL_TAINT=${PHP_WORKER_INSTALL_TAINT}
232232
- INSTALL_FFMPEG=${PHP_WORKER_INSTALL_FFMPEG}
233233
- INSTALL_GMP=${PHP_WORKER_INSTALL_GMP}
234+
- INSTALL_REDIS=${PHP_WORKER_INSTALL_REDIS}
234235
- PUID=${PHP_WORKER_PUID}
235236
- PGID=${PHP_WORKER_PGID}
236237
volumes:

env-example

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,7 @@ PHP_WORKER_INSTALL_TAINT=false
208208
PHP_WORKER_INSTALL_FFMPEG=false
209209
PHP_WORKER_INSTALL_GMP=false
210210
PHP_WORKER_INSTALL_CASSANDRA=false
211+
PHP_WORKER_INSTALL_REDIS=false
211212

212213
PHP_WORKER_PUID=1000
213214
PHP_WORKER_PGID=1000

php-worker/Dockerfile

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,14 @@ RUN if [ ${INSTALL_GMP} = true ]; then \
134134
RUN rm /var/cache/apk/* \
135135
&& mkdir -p /var/www
136136

137+
# Install Redis package:
138+
ARG INSTALL_REDIS=false
139+
RUN if [ ${INSTALL_REDIS} = true ]; then \
140+
# Install Redis Extension
141+
printf "\n" | pecl install -o -f redis \
142+
&& rm -rf /tmp/pear \
143+
&& docker-php-ext-enable redis \
144+
;fi
137145

138146
###########################################################################
139147
# Swoole EXTENSION

0 commit comments

Comments
 (0)