Merge pull request #3339 from leonschiphol/add_apcu_to_workspace

Add APCU installation option for the workspace and php-worker containers
This commit is contained in:
Shao Yu-Lung (Allen) 2023-03-30 07:54:23 +08:00 committed by GitHub
commit 9159c70d10
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 31 additions and 0 deletions

View File

@ -183,6 +183,7 @@ WORKSPACE_INSTALL_YAML=false
WORKSPACE_INSTALL_RDKAFKA=false
WORKSPACE_INSTALL_MAILPARSE=false
WORKSPACE_INSTALL_XMLRPC=false
WORKSPACE_INSTALL_APCU=false
WORKSPACE_PUID=1000
WORKSPACE_PGID=1000
WORKSPACE_CHROME_DRIVER_VERSION=2.42
@ -316,6 +317,7 @@ PHP_WORKER_INSTALL_MEMCACHED=false
PHP_WORKER_INSTALL_OCI8=false
PHP_WORKER_INSTALL_MSSQL=false
PHP_WORKER_INSTALL_PHALCON=false
PHP_WORKER_INSTALL_APCU=false
PHP_WORKER_INSTALL_SOAP=false
PHP_WORKER_INSTALL_ZIP_ARCHIVE=false
PHP_WORKER_INSTALL_MYSQL_CLIENT=false

View File

@ -136,6 +136,7 @@ services:
- INSTALL_LIBPNG=${WORKSPACE_INSTALL_LIBPNG}
- INSTALL_GRAPHVIZ=${WORKSPACE_INSTALL_GRAPHVIZ}
- INSTALL_IONCUBE=${WORKSPACE_INSTALL_IONCUBE}
- INSTALL_APCU=${WORKSPACE_INSTALL_APCU}
- INSTALL_MYSQL_CLIENT=${WORKSPACE_INSTALL_MYSQL_CLIENT}
- INSTALL_PING=${WORKSPACE_INSTALL_PING}
- INSTALL_SSHPASS=${WORKSPACE_INSTALL_SSHPASS}
@ -339,6 +340,7 @@ services:
- INSTALL_OCI8=${PHP_WORKER_INSTALL_OCI8}
- INSTALL_MSSQL=${PHP_WORKER_INSTALL_MSSQL}
- INSTALL_PHALCON=${PHP_WORKER_INSTALL_PHALCON}
- INSTALL_APCU=${PHP_WORKER_INSTALL_APCU}
- INSTALL_XLSWRITER=${PHP_WORKER_INSTALL_XLSWRITER}
- INSTALL_SOAP=${PHP_WORKER_INSTALL_SOAP}
- INSTALL_ZIP_ARCHIVE=${PHP_WORKER_INSTALL_ZIP_ARCHIVE}

View File

@ -327,6 +327,18 @@ RUN if [ $INSTALL_PHALCON = true ]; then \
php -m | grep -q 'phalcon' \
;fi
# Install APCU ext
ARG INSTALL_APCU=false
RUN if [ ${INSTALL_APCU} = true ]; then \
if [ $(php -r "echo PHP_MAJOR_VERSION;") = "5" ]; then \
pecl install -a apcu-4.0.11; \
else \
pecl install apcu; \
fi && \
docker-php-ext-enable apcu \
;fi
ARG INSTALL_GHOSTSCRIPT=false
RUN if [ $INSTALL_GHOSTSCRIPT = true ]; then \
apk --update add ghostscript \

View File

@ -1339,6 +1339,21 @@ RUN if [ $INSTALL_PHALCON = true ]; then \
php -m | grep -q 'phalcon' \
;fi
###########################################################################
# APCU:
###########################################################################
ARG INSTALL_APCU=false
RUN if [ ${INSTALL_APCU} = true ]; then \
apt-get update -yqq \
&& pecl channel-update pecl.php.net; \
pecl install apcu; \
echo "extension=apcu.so" >> /etc/php/${LARADOCK_PHP_VERSION}/mods-available/apcu.ini; \
ln -s /etc/php/${LARADOCK_PHP_VERSION}/mods-available/apcu.ini /etc/php/${LARADOCK_PHP_VERSION}/cli/conf.d/50-apcu.ini; \
php -m | grep -q 'apcu' \
;fi
###########################################################################
USER root