diff --git a/README.md b/README.md
index 89d98d44..a2dd91a2 100644
--- a/README.md
+++ b/README.md
@@ -120,6 +120,7 @@ Let's see how easy it is to install `NGINX`, `PHP`, `Composer`, `MySQL` and `Red
- **Cache Engines:**
- Redis
- Memcached
+ - Aerospike
- **PHP Servers:**
- NGINX
- Apache2
@@ -250,7 +251,7 @@ docker-compose up -d nginx mysql
You can select your own combination of Containers form the list below:
-`nginx`, `hhvm`, `php-fpm`, `mysql`, `redis`, `postgres`, `mariadb`, `neo4j`, `mongo`, `apache2`, `caddy`, `memcached`, `beanstalkd`, `beanstalkd-console`, `rabbitmq`, `workspace`, `phpmyadmin`.
+`nginx`, `hhvm`, `php-fpm`, `mysql`, `redis`, `postgres`, `mariadb`, `neo4j`, `mongo`, `apache2`, `caddy`, `memcached`, `beanstalkd`, `beanstalkd-console`, `rabbitmq`, `workspace`, `phpmyadmin`, `aerospike`.
**Note**: `workspace` and `php-fpm` will run automatically in most of the cases, so no need to specify them in the `up` command.
@@ -995,7 +996,40 @@ It should be like this:
3 - Re-build the container `docker-compose build workspace`
+
+
+### Install Aerospike extension
+1 - First install `aerospike` in the Workspace and the PHP-FPM Containers:
+
+a) open the `docker-compose.yml` file
+
+b) search for the `INSTALL_AEROSPIKE_EXTENSION` argument under the Workspace Container
+
+c) set it to `true`
+
+d) search for the `INSTALL_AEROSPIKE_EXTENSION` argument under the PHP-FPM Container
+
+e) set it to `true`
+
+It should be like this:
+
+```yml
+ workspace:
+ build:
+ context: ./workspace
+ args:
+ - INSTALL_AEROSPIKE_EXTENSION=true
+ ...
+ php-fpm:
+ build:
+ context: ./php-fpm
+ args:
+ - INSTALL_AEROSPIKE_EXTENSION=true
+ ...
+```
+
+2 - Re-build the containers `docker-compose build workspace php-fpm`
diff --git a/aerospike/Dockerfile b/aerospike/Dockerfile
new file mode 100644
index 00000000..665a279c
--- /dev/null
+++ b/aerospike/Dockerfile
@@ -0,0 +1,7 @@
+FROM aerospike:latest
+
+MAINTAINER Luciano Jr
+
+RUN rm /etc/aerospike/aerospike.conf
+
+ADD aerospike.conf /etc/aerospike/aerospike.conf
\ No newline at end of file
diff --git a/aerospike/aerospike.conf b/aerospike/aerospike.conf
new file mode 100644
index 00000000..5e577759
--- /dev/null
+++ b/aerospike/aerospike.conf
@@ -0,0 +1,77 @@
+# Aerospike database configuration file.
+
+# This stanza must come first.
+service {
+ user root
+ group root
+ paxos-single-replica-limit 1 # Number of nodes where the replica count is automatically reduced to 1.
+ pidfile /var/run/aerospike/asd.pid
+ service-threads 4
+ transaction-queues 4
+ transaction-threads-per-queue 4
+ proto-fd-max 15000
+}
+
+logging {
+
+ # Log file must be an absolute path.
+ file /var/log/aerospike/aerospike.log {
+ context any info
+ }
+
+ # Send log messages to stdout
+ console {
+ context any critical
+ }
+}
+
+network {
+ service {
+ address any
+ port 3000
+
+ # Uncomment the following to set the `access-address` parameter to the
+ # IP address of the Docker host. This will the allow the server to correctly
+ # publish the address which applications and other nodes in the cluster to
+ # use when addressing this node.
+ # access-address
+ }
+
+ heartbeat {
+
+ # mesh is used for environments that do not support multicast
+ mode mesh
+ port 3002
+
+ # use asinfo -v 'tip:host=;port=3002' to inform cluster of
+ # other mesh nodes
+ mesh-port 3002
+
+ interval 150
+ timeout 10
+ }
+
+ fabric {
+ port 3001
+ }
+
+ info {
+ port 3003
+ }
+}
+
+namespace test {
+ replication-factor 2
+ memory-size 1G
+ default-ttl 5d # 5 days, use 0 to never expire/evict.
+
+ # storage-engine memory
+
+ # To use file storage backing, comment out the line above and use the
+ # following lines instead.
+ storage-engine device {
+ file /opt/aerospike/data/test.dat
+ filesize 4G
+ data-in-memory true # Store data in memory in addition to file.
+ }
+}
diff --git a/docker-compose.yml b/docker-compose.yml
index cf7b804e..76892f11 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
- INSTALL_WORKSPACE_SSH=false
- PUID=1000
@@ -37,6 +38,7 @@ services:
- INSTALL_ZIP_ARCHIVE=false
- INSTALL_MEMCACHED=false
- INSTALL_OPCACHE=false
+ - INSTALL_AEROSPIKE_EXTENSION=false
dockerfile: Dockerfile-70
volumes_from:
- volumes_source
@@ -169,6 +171,20 @@ services:
ports:
- "6379:6379"
+### Aerospike c Container #########################################
+
+ aerospike:
+ build: ./aerospike
+ volumes_from:
+ - workspace
+ - volumes_data
+ ports:
+ - "3000:3000"
+ - "3001:3001"
+ - "3002:3002"
+ - "3003:3003"
+
+
### Memcached Container #####################################
memcached:
@@ -270,6 +286,7 @@ services:
- ./data/redis:/data
- ./data/neo4j:/var/lib/neo4j/data
- ./data/mongo:/data/db
+ - ./data/aerospike:/opt/aerospike/data
- ./data/sessions:/sessions
### Add more Containers below ###############################
diff --git a/php-fpm/Dockerfile-70 b/php-fpm/Dockerfile-70
index af39aa48..3450dc67 100644
--- a/php-fpm/Dockerfile-70
+++ b/php-fpm/Dockerfile-70
@@ -94,6 +94,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:
#####################################
@@ -122,4 +144,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 97e3f03c..96bc3877 100644
--- a/workspace/Dockerfile
+++ b/workspace/Dockerfile
@@ -165,6 +165,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