-
Notifications
You must be signed in to change notification settings - Fork 2
/
Dockerfile
34 lines (27 loc) · 1.27 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
FROM redislabs/redisearch:edge as redisearch
FROM redislabs/redisgraph:edge as redisgraph
FROM redislabs/rejson:edge as rejson
FROM redislabs/redisgears:edge
ENV LD_LIBRARY_PATH=/usr/lib/redis/modules
ARG MODULES=/var/opt/redislabs/lib/modules
ARG RG=${MODULES}/redisgears.so
ARG REDIS="redis-server --loadmodule ${RG} Plugin /var/opt/redislabs/modules/rg/plugin/gears_python.so"
ARG DEPS="gcc g++ build-essential python3-pip"
# Set up a build environment
WORKDIR /data
RUN set -ex;\
deps="$DEPS";\
apt-get update;\
apt-get install -y --no-install-recommends $deps;
# Copy Modules
COPY --from=redisearch ${LD_LIBRARY_PATH}/redisearch.so ${LD_LIBRARY_PATH}/
COPY --from=redisgraph ${LD_LIBRARY_PATH}/redisgraph.so ${LD_LIBRARY_PATH}/
COPY --from=rejson ${LD_LIBRARY_PATH}/*.so ${LD_LIBRARY_PATH}/
# Start Redis and verify
RUN nohup bash -c "${REDIS}&" && sleep 4 && redis-cli RG.PYEXECUTE "GearsBuilder().run()" && redis-cli save
ENTRYPOINT ["redis-server"]
CMD ["--loadmodule", "/usr/lib/redis/modules/redisearch.so", \
"--loadmodule", "/usr/lib/redis/modules/redisgraph.so", \
"--loadmodule", "/usr/lib/redis/modules/rejson.so", \
"--loadmodule", "/var/opt/redislabs/lib/modules/redisgears.so", \
"Plugin", "/var/opt/redislabs/modules/rg/plugin/gears_python.so"]