Skip to content

Commit 254a9ae

Browse files
liyu001989bestlong
authored andcommitted
php-woker add swoole (laradock#2045)
1 parent 8ca26e6 commit 254a9ae

3 files changed

Lines changed: 24 additions & 0 deletions

File tree

docker-compose.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,7 @@ services:
199199
- INSTALL_MYSQL_CLIENT=${PHP_WORKER_INSTALL_MYSQL_CLIENT}
200200
- INSTALL_AMQP=${PHP_WORKER_INSTALL_AMQP}
201201
- INSTALL_GHOSTSCRIPT=${PHP_WORKER_INSTALL_GHOSTSCRIPT}
202+
- INSTALL_SWOOLE=${PHP_WORKER_INSTALL_SWOOLE}
202203
- PUID=${PHP_WORKER_PUID}
203204
- PGID=${PHP_WORKER_PGID}
204205
volumes:

env-example

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,7 @@ PHP_WORKER_INSTALL_ZIP_ARCHIVE=false
186186
PHP_WORKER_INSTALL_MYSQL_CLIENT=false
187187
PHP_WORKER_INSTALL_AMQP=false
188188
PHP_WORKER_INSTALL_GHOSTSCRIPT=false
189+
PHP_WORKER_INSTALL_SWOOLE=true
189190
PHP_WORKER_PUID=1000
190191
PHP_WORKER_PGID=1000
191192

php-worker/Dockerfile

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,28 @@ RUN if [ $INSTALL_GHOSTSCRIPT = true ]; then \
100100
RUN rm /var/cache/apk/* \
101101
&& mkdir -p /var/www
102102

103+
104+
###########################################################################
105+
# Swoole EXTENSION
106+
###########################################################################
107+
108+
ARG INSTALL_SWOOLE=false
109+
110+
RUN if [ ${INSTALL_SWOOLE} = true ]; then \
111+
# Install Php Swoole Extension
112+
if [ $(php -r "echo PHP_MAJOR_VERSION;") = "5" ]; then \
113+
pecl -q install swoole-2.0.10; \
114+
else \
115+
if [ $(php -r "echo PHP_MINOR_VERSION;") = "0" ]; then \
116+
pecl install swoole-2.2.0; \
117+
else \
118+
pecl install swoole; \
119+
fi \
120+
fi \
121+
&& docker-php-ext-enable swoole \
122+
;fi
123+
124+
103125
#
104126
#--------------------------------------------------------------------------
105127
# Optional Supervisord Configuration

0 commit comments

Comments
 (0)