php-worker mongodb install by .env config

This commit is contained in:
Shao Yu Lung 2021-03-20 19:15:59 +08:00
parent 4503360576
commit 6008b3c1ea
3 changed files with 11 additions and 2 deletions

View File

@ -308,6 +308,7 @@ services:
- INSTALL_IMAGEMAGICK=${PHP_WORKER_INSTALL_IMAGEMAGICK}
- INSTALL_GMP=${PHP_WORKER_INSTALL_GMP}
- INSTALL_PGSQL=${PHP_WORKER_INSTALL_PGSQL}
- INSTALL_MONGO=${PHP_WORKER_INSTALL_MONGO}
- INSTALL_BCMATH=${PHP_WORKER_INSTALL_BCMATH}
- INSTALL_OCI8=${PHP_WORKER_INSTALL_OCI8}
- INSTALL_PHALCON=${PHP_WORKER_INSTALL_PHALCON}

View File

@ -278,6 +278,7 @@ PHP_WORKER_INSTALL_IMAGEMAGICK=false
PHP_WORKER_IMAGEMAGICK_VERSION=latest
PHP_WORKER_INSTALL_GMP=false
PHP_WORKER_INSTALL_PGSQL=false
PHP_WORKER_INSTALL_MONGO=false
PHP_WORKER_INSTALL_BCMATH=false
# PHP_WORKER_INSTALL_OCI8 Does not work in php5.6 version
PHP_WORKER_INSTALL_OCI8=false

View File

@ -38,9 +38,9 @@ RUN apk --update add wget \
RUN docker-php-ext-install mysqli mbstring pdo pdo_mysql tokenizer xml pcntl
RUN if [ $(php -r "echo PHP_MAJOR_VERSION;") = "5" ]; then \
pecl channel-update pecl.php.net && pecl install memcached-2.2.0 mcrypt-1.0.1 mongodb && docker-php-ext-enable memcached mongodb \
pecl channel-update pecl.php.net && pecl install memcached-2.2.0 mcrypt-1.0.1 && docker-php-ext-enable memcached \
;else \
pecl channel-update pecl.php.net && pecl install memcached mcrypt-1.0.1 mongodb && docker-php-ext-enable memcached mongodb \
pecl channel-update pecl.php.net && pecl install memcached mcrypt-1.0.1 && docker-php-ext-enable memcached \
;fi
# Add a non-root user:
@ -108,6 +108,13 @@ RUN if [ ${INSTALL_SOAP} = true ]; then \
docker-php-ext-install soap \
;fi
# Install MongoDB drivers:
ARG INSTALL_MONGO=false
RUN if [ ${INSTALL_MONGO} = true ]; then \
pecl install mongodb; \
docker-php-ext-enable mongodb; \
fi
#Install BCMath package:
ARG INSTALL_BCMATH=false
RUN if [ ${INSTALL_BCMATH} = true ]; then \