File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ FROM aerospike:latest
2+
3+ MAINTAINER Luciano Jr <luciano@lucianojr.com.br>
4+
5+ RUN rm /etc/aerospike/aerospike.conf
6+
7+ ADD aerospike.conf /etc/aerospike/aerospike.conf
Original file line number Diff line number Diff line change 1+ # Aerospike database configuration file.
2+
3+ # This stanza must come first.
4+ service {
5+ user root
6+ group root
7+ paxos-single-replica-limit 1 # Number of nodes where the replica count is automatically reduced to 1.
8+ pidfile /var/run/aerospike/asd.pid
9+ service-threads 4
10+ transaction-queues 4
11+ transaction-threads-per-queue 4
12+ proto-fd-max 15000
13+ }
14+
15+ logging {
16+
17+ # Log file must be an absolute path.
18+ file /var/log/aerospike/aerospike.log {
19+ context any info
20+ }
21+
22+ # Send log messages to stdout
23+ console {
24+ context any critical
25+ }
26+ }
27+
28+ network {
29+ service {
30+ address any
31+ port 3000
32+
33+ # Uncomment the following to set the `access-address` parameter to the
34+ # IP address of the Docker host. This will the allow the server to correctly
35+ # publish the address which applications and other nodes in the cluster to
36+ # use when addressing this node.
37+ # access-address <IPADDR>
38+ }
39+
40+ heartbeat {
41+
42+ # mesh is used for environments that do not support multicast
43+ mode mesh
44+ port 3002
45+
46+ # use asinfo -v 'tip:host=<ADDR>;port=3002' to inform cluster of
47+ # other mesh nodes
48+ mesh-port 3002
49+
50+ interval 150
51+ timeout 10
52+ }
53+
54+ fabric {
55+ port 3001
56+ }
57+
58+ info {
59+ port 3003
60+ }
61+ }
62+
63+ namespace test {
64+ replication-factor 2
65+ memory-size 1G
66+ default-ttl 5d # 5 days, use 0 to never expire/evict.
67+
68+ # storage-engine memory
69+
70+ # To use file storage backing, comment out the line above and use the
71+ # following lines instead.
72+ storage-engine device {
73+ file /opt/aerospike/data/test.dat
74+ filesize 4G
75+ data-in-memory true # Store data in memory in addition to file.
76+ }
77+ }
Original file line number Diff line number Diff 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 - INSTALL_WORKSPACE_SSH=false
1718 - PUID=1000
@@ -37,6 +38,7 @@ services:
3738 - INSTALL_ZIP_ARCHIVE=false
3839 - INSTALL_MEMCACHED=false
3940 - INSTALL_OPCACHE=false
41+ - INSTALL_AEROSPIKE_EXTENSION=false
4042 dockerfile : Dockerfile-70
4143 volumes_from :
4244 - volumes_source
@@ -169,6 +171,20 @@ services:
169171 ports :
170172 - " 6379:6379"
171173
174+ # ## Aerospike c Container #########################################
175+
176+ aerospike :
177+ build : ./aerospike
178+ volumes_from :
179+ - workspace
180+ - volumes_data
181+ ports :
182+ - " 3000:3000"
183+ - " 3001:3001"
184+ - " 3002:3002"
185+ - " 3003:3003"
186+
187+
172188# ## Memcached Container #####################################
173189
174190 memcached :
@@ -270,6 +286,7 @@ services:
270286 - ./data/redis:/data
271287 - ./data/neo4j:/var/lib/neo4j/data
272288 - ./data/mongo:/data/db
289+ - ./data/aerospike:/opt/aerospike/data
273290 - ./data/sessions:/sessions
274291
275292# ## Add more Containers below ###############################
Original file line number Diff line number Diff line change @@ -94,6 +94,28 @@ RUN if [ ${INSTALL_MEMCACHED} = true ]; then \
9494 && docker-php-ext-enable memcached \
9595;fi
9696
97+ #####################################
98+ # PHP Aerospike:
99+ #####################################
100+
101+ ARG INSTALL_AEROSPIKE_EXTENSION=true
102+ ENV INSTALL_AEROSPIKE_EXTENSION ${INSTALL_AEROSPIKE_EXTENSION}
103+ # Copy aerospike configration for remote debugging
104+ COPY ./aerospike.ini /usr/local/etc/php/conf.d/aerospike.ini
105+ RUN if [ ${INSTALL_AEROSPIKE_EXTENSION} = true ]; then \
106+ # Install the php aerospike extension
107+ curl -L -o /tmp/aerospike-client-php.tar.gz "https://github.com/luciano-jr/aerospike-client-php/archive/master.tar.gz" \
108+ && mkdir -p aerospike-client-php \
109+ && tar -C aerospike-client-php -zxvf /tmp/aerospike-client-php.tar.gz --strip 1 \
110+ && ( \
111+ cd aerospike-client-php/src/aerospike \
112+ && phpize \
113+ && ./build.sh \
114+ && make install \
115+ ) \
116+ && rm /tmp/aerospike-client-php.tar.gz \
117+ ;fi
118+
97119#####################################
98120# Opcache:
99121#####################################
@@ -122,4 +144,4 @@ WORKDIR /var/www/laravel
122144
123145CMD ["php-fpm"]
124146
125- EXPOSE 9000
147+ EXPOSE 9000
Original file line number Diff line number Diff line change 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
Original file line number Diff line number Diff line change @@ -165,6 +165,28 @@ RUN if [ ${INSTALL_NODE} = true ]; then \
165165 echo '[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" # This loads nvm' >> ~/.bashrc \
166166;fi
167167
168+ # ####################################
169+ # PHP Aerospike:
170+ # ####################################
171+ USER root
172+ ARG INSTALL_AEROSPIKE_EXTENSION=true
173+ ENV INSTALL_AEROSPIKE_EXTENSION ${INSTALL_AEROSPIKE_EXTENSION}
174+ # Copy aerospike configration for remote debugging
175+ COPY ./aerospike.ini /etc/php/7.0/cli/conf.d/aerospike.ini
176+ RUN if [ ${INSTALL_AEROSPIKE_EXTENSION} = true ]; then \
177+ # Install the php aerospike extension
178+ curl -L -o /tmp/aerospike-client-php.tar.gz "https://github.com/luciano-jr/aerospike-client-php/archive/master.tar.gz" \
179+ && mkdir -p aerospike-client-php \
180+ && tar -C aerospike-client-php -zxvf /tmp/aerospike-client-php.tar.gz --strip 1 \
181+ && ( \
182+ cd aerospike-client-php/src/aerospike \
183+ && phpize \
184+ && ./build.sh \
185+ && make install \
186+ ) \
187+ && rm /tmp/aerospike-client-php.tar.gz \
188+ ;fi
189+
168190#
169191# --------------------------------------------------------------------------
170192# Final Touch
Original file line number Diff line number Diff line change 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
You can’t perform that action at this time.
0 commit comments