Skip to content

Commit 1afad7f

Browse files
committed
Add configuration to install aerospike php extension
1 parent 9bd70aa commit 1afad7f

File tree

5 files changed

+56
-2
lines changed

5 files changed

+56
-2
lines changed

docker-compose.yml

+5-1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ services:
1212
- INSTALL_MONGO=false
1313
- INSTALL_NODE=false
1414
- INSTALL_DRUSH=false
15+
- INSTALL_AEROSPIKE_EXTENSION=false
1516
- COMPOSER_GLOBAL_INSTALL=false
1617
- PUID=1000
1718
- PGID=1000
@@ -33,6 +34,7 @@ services:
3334
- INSTALL_ZIP_ARCHIVE=false
3435
- INSTALL_MEMCACHED=false
3536
- INSTALL_OPCACHE=false
37+
- INSTALL_AEROSPIKE_EXTENSION=false
3638
dockerfile: Dockerfile-70
3739
volumes_from:
3840
- volumes_source
@@ -163,7 +165,7 @@ services:
163165
ports:
164166
- "6379:6379"
165167

166-
### Aerospike Container #########################################
168+
### Aerospike c Container #########################################
167169

168170
aerospike:
169171
build: ./aerospike
@@ -174,6 +176,8 @@ services:
174176
- "3001:3001"
175177
- "3002:3002"
176178
- "3003:3003"
179+
volumes_from:
180+
- workspace
177181

178182
### Memcached Container #####################################
179183

php-fpm/Dockerfile-70

+23-1
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,28 @@ RUN if [ ${INSTALL_MEMCACHED} = true ]; then \
9898
&& docker-php-ext-enable memcached \
9999
;fi
100100

101+
#####################################
102+
# PHP Aerospike:
103+
#####################################
104+
105+
ARG INSTALL_AEROSPIKE_EXTENSION=true
106+
ENV INSTALL_AEROSPIKE_EXTENSION ${INSTALL_AEROSPIKE_EXTENSION}
107+
# Copy aerospike configration for remote debugging
108+
COPY ./aerospike.ini /usr/local/etc/php/conf.d/aerospike.ini
109+
RUN if [ ${INSTALL_AEROSPIKE_EXTENSION} = true ]; then \
110+
# Install the php aerospike extension
111+
curl -L -o /tmp/aerospike-client-php.tar.gz "https://github.com/luciano-jr/aerospike-client-php/archive/master.tar.gz" \
112+
&& mkdir -p aerospike-client-php \
113+
&& tar -C aerospike-client-php -zxvf /tmp/aerospike-client-php.tar.gz --strip 1 \
114+
&& ( \
115+
cd aerospike-client-php/src/aerospike \
116+
&& phpize \
117+
&& ./build.sh \
118+
&& make install \
119+
) \
120+
&& rm /tmp/aerospike-client-php.tar.gz \
121+
;fi
122+
101123
#####################################
102124
# Opcache:
103125
#####################################
@@ -127,4 +149,4 @@ WORKDIR /var/www/laravel
127149

128150
CMD ["php-fpm"]
129151

130-
EXPOSE 9000
152+
EXPOSE 9000

php-fpm/aerospike.ini

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
extension=aerospike.so
2+
aerospike.udf.lua_system_path=/usr/local/aerospike/lua
3+
aerospike.udf.lua_user_path=/usr/local/aerospike/usr-lua

workspace/Dockerfile

+22
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,28 @@ RUN if [ ${INSTALL_NODE} = true ]; then \
140140
echo '[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" # This loads nvm' >> ~/.bashrc \
141141
;fi
142142

143+
#####################################
144+
# PHP Aerospike:
145+
#####################################
146+
USER root
147+
ARG INSTALL_AEROSPIKE_EXTENSION=true
148+
ENV INSTALL_AEROSPIKE_EXTENSION ${INSTALL_AEROSPIKE_EXTENSION}
149+
# Copy aerospike configration for remote debugging
150+
COPY ./aerospike.ini /etc/php/7.0/cli/conf.d/aerospike.ini
151+
RUN if [ ${INSTALL_AEROSPIKE_EXTENSION} = true ]; then \
152+
# Install the php aerospike extension
153+
curl -L -o /tmp/aerospike-client-php.tar.gz "https://github.com/luciano-jr/aerospike-client-php/archive/master.tar.gz" \
154+
&& mkdir -p aerospike-client-php \
155+
&& tar -C aerospike-client-php -zxvf /tmp/aerospike-client-php.tar.gz --strip 1 \
156+
&& ( \
157+
cd aerospike-client-php/src/aerospike \
158+
&& phpize \
159+
&& ./build.sh \
160+
&& make install \
161+
) \
162+
&& rm /tmp/aerospike-client-php.tar.gz \
163+
;fi
164+
143165
#
144166
#--------------------------------------------------------------------------
145167
# Final Touch

workspace/aerospike.ini

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
extension=aerospike.so
2+
aerospike.udf.lua_system_path=/usr/local/aerospike/lua
3+
aerospike.udf.lua_user_path=/usr/local/aerospike/usr-lua

0 commit comments

Comments
 (0)