From 1afad7f14cb9a5acb50344c88be5ab3bed81ba45 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luciano=20Gon=C3=A7alves?= Date: Sat, 20 Aug 2016 18:57:01 +0100 Subject: [PATCH] Add configuration to install aerospike php extension --- docker-compose.yml | 6 +++++- php-fpm/Dockerfile-70 | 24 +++++++++++++++++++++++- php-fpm/aerospike.ini | 3 +++ workspace/Dockerfile | 22 ++++++++++++++++++++++ workspace/aerospike.ini | 3 +++ 5 files changed, 56 insertions(+), 2 deletions(-) create mode 100644 php-fpm/aerospike.ini create mode 100644 workspace/aerospike.ini diff --git a/docker-compose.yml b/docker-compose.yml index 4f37f092..c970d9a4 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -12,6 +12,7 @@ services: - INSTALL_MONGO=false - INSTALL_NODE=false - INSTALL_DRUSH=false + - INSTALL_AEROSPIKE_EXTENSION=false - COMPOSER_GLOBAL_INSTALL=false - PUID=1000 - PGID=1000 @@ -33,6 +34,7 @@ services: - INSTALL_ZIP_ARCHIVE=false - INSTALL_MEMCACHED=false - INSTALL_OPCACHE=false + - INSTALL_AEROSPIKE_EXTENSION=false dockerfile: Dockerfile-70 volumes_from: - volumes_source @@ -163,7 +165,7 @@ services: ports: - "6379:6379" -### Aerospike Container ######################################### +### Aerospike c Container ######################################### aerospike: build: ./aerospike @@ -174,6 +176,8 @@ services: - "3001:3001" - "3002:3002" - "3003:3003" + volumes_from: + - workspace ### Memcached Container ##################################### diff --git a/php-fpm/Dockerfile-70 b/php-fpm/Dockerfile-70 index fe412775..7b278161 100644 --- a/php-fpm/Dockerfile-70 +++ b/php-fpm/Dockerfile-70 @@ -98,6 +98,28 @@ RUN if [ ${INSTALL_MEMCACHED} = true ]; then \ && docker-php-ext-enable memcached \ ;fi +##################################### +# PHP Aerospike: +##################################### + +ARG INSTALL_AEROSPIKE_EXTENSION=true +ENV INSTALL_AEROSPIKE_EXTENSION ${INSTALL_AEROSPIKE_EXTENSION} +# Copy aerospike configration for remote debugging +COPY ./aerospike.ini /usr/local/etc/php/conf.d/aerospike.ini +RUN if [ ${INSTALL_AEROSPIKE_EXTENSION} = true ]; then \ + # Install the php aerospike extension + curl -L -o /tmp/aerospike-client-php.tar.gz "https://github.com/luciano-jr/aerospike-client-php/archive/master.tar.gz" \ + && mkdir -p aerospike-client-php \ + && tar -C aerospike-client-php -zxvf /tmp/aerospike-client-php.tar.gz --strip 1 \ + && ( \ + cd aerospike-client-php/src/aerospike \ + && phpize \ + && ./build.sh \ + && make install \ + ) \ + && rm /tmp/aerospike-client-php.tar.gz \ +;fi + ##################################### # Opcache: ##################################### @@ -127,4 +149,4 @@ WORKDIR /var/www/laravel CMD ["php-fpm"] -EXPOSE 9000 +EXPOSE 9000 \ No newline at end of file diff --git a/php-fpm/aerospike.ini b/php-fpm/aerospike.ini new file mode 100644 index 00000000..f9c8f614 --- /dev/null +++ b/php-fpm/aerospike.ini @@ -0,0 +1,3 @@ +extension=aerospike.so +aerospike.udf.lua_system_path=/usr/local/aerospike/lua +aerospike.udf.lua_user_path=/usr/local/aerospike/usr-lua \ No newline at end of file diff --git a/workspace/Dockerfile b/workspace/Dockerfile index e869bfab..cd73a4c6 100644 --- a/workspace/Dockerfile +++ b/workspace/Dockerfile @@ -140,6 +140,28 @@ RUN if [ ${INSTALL_NODE} = true ]; then \ echo '[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" # This loads nvm' >> ~/.bashrc \ ;fi +##################################### +# PHP Aerospike: +##################################### +USER root +ARG INSTALL_AEROSPIKE_EXTENSION=true +ENV INSTALL_AEROSPIKE_EXTENSION ${INSTALL_AEROSPIKE_EXTENSION} +# Copy aerospike configration for remote debugging +COPY ./aerospike.ini /etc/php/7.0/cli/conf.d/aerospike.ini +RUN if [ ${INSTALL_AEROSPIKE_EXTENSION} = true ]; then \ + # Install the php aerospike extension + curl -L -o /tmp/aerospike-client-php.tar.gz "https://github.com/luciano-jr/aerospike-client-php/archive/master.tar.gz" \ + && mkdir -p aerospike-client-php \ + && tar -C aerospike-client-php -zxvf /tmp/aerospike-client-php.tar.gz --strip 1 \ + && ( \ + cd aerospike-client-php/src/aerospike \ + && phpize \ + && ./build.sh \ + && make install \ + ) \ + && rm /tmp/aerospike-client-php.tar.gz \ +;fi + # #-------------------------------------------------------------------------- # Final Touch diff --git a/workspace/aerospike.ini b/workspace/aerospike.ini new file mode 100644 index 00000000..f9c8f614 --- /dev/null +++ b/workspace/aerospike.ini @@ -0,0 +1,3 @@ +extension=aerospike.so +aerospike.udf.lua_system_path=/usr/local/aerospike/lua +aerospike.udf.lua_user_path=/usr/local/aerospike/usr-lua \ No newline at end of file