diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..badfb50 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,15 @@ +FROM redislabs/redistimeseries:0.2.0 as redistimeseries +FROM redislabs/redisgraph:1.2.0 as redisgraph +FROM redislabs/redisearch:1.4.8 as redisearch +FROM redislabs/redisgears:0.2.1 as redisgears + +ENV LD_LIBRARY_PATH /usr/lib/redis/modules/ + +COPY --from=redistimeseries /usr/lib/redis/modules/*.so* "$LD_LIBRARY_PATH" +COPY --from=redisgraph /usr/lib/redis/modules/*.so* "$LD_LIBRARY_PATH" +COPY --from=redisearch /usr/lib/redis/modules/*.so* "$LD_LIBRARY_PATH" + +WORKDIR /app +ADD . /app + +ENTRYPOINT [ "./script.sh" ] diff --git a/script.sh b/script.sh index 099d54b..01119fe 100755 --- a/script.sh +++ b/script.sh @@ -1,18 +1,20 @@ #!/bin/bash -x +nohup redis-server & +sleep 5 -redis-cli MODULE LOAD `pwd`/redisgears.so +redis-cli MODULE LOAD /usr/lib/redis/modules/redisgears.so "PythonHomeDir" "/usr/lib/redis/modules/deps/cpython/" read redis-cli HSET marsman:100 Name Douglas Last Quaid redis-cli HSET marsman:101 Name Lori Last Quaid # Quaid's seemingly loving wife -redis-cli HSET marsman:102 Name Melina Last Melina +redis-cli HSET marsman:102 Name Melina Last Melina read -p "Back to slides..." -######## RediSearch ################################################################################################# +######## RediSearch ################################################################################################# -redis-cli MODULE LOAD `pwd`/redisearch.so SAFEMODE +redis-cli MODULE LOAD /usr/lib/redis/modules/redisearch.so SAFEMODE read @@ -39,8 +41,8 @@ redis-cli FT.SEARCH marsmen Qu* read -p "Back to slides..." -redis-cli HSET marsman:103 Name Vilos Last Cohaagen # Governor of the Mars -redis-cli HSET marsman:104 Name Bob Last McClane # Rekall manager and sales agent +redis-cli HSET marsman:103 Name Vilos Last Cohaagen # Governor of the Mars +redis-cli HSET marsman:104 Name Bob Last McClane # Rekall manager and sales agent redis-cli HSET marsman:105 Name Harry Last Harry # Douglas friend read @@ -48,9 +50,9 @@ redis-cli FT.SEARCH marsmen mcc* read -p "Back to slides..." -######## RedisGraph ################################################################################################# +######## RedisGraph ################################################################################################# -redis-cli MODULE LOAD `pwd`/redisgraph.so +redis-cli MODULE LOAD /usr/lib/redis/modules/redisgraph.so read @@ -98,7 +100,7 @@ redis-cli GRAPH.QUERY marsmen "MATCH (n)-[:Relation]->(m) return n.Name, m.Name" read -p "Back to slides..." -redis-cli HDEL marsman:101 Relation # Quaid killed! Lori +redis-cli HDEL marsman:101 Relation # Quaid killed! Lori read @@ -106,9 +108,9 @@ redis-cli GRAPH.QUERY marsmen "MATCH (n)-[:Relation]->(m) return n.Name, m.Name" read -p "Back to slides..." -######## RedisTimeSeries ############################################################################################ +######## RedisTimeSeries ############################################################################################ -redis-cli MODULE LOAD `pwd`/redistimeseries.so +redis-cli MODULE LOAD /usr/lib/redis/modules/redistimeseries.so read