forked from RedisJSON/RedisJSON
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
30 lines (23 loc) · 764 Bytes
/
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
FROM rust:latest as builder
ENV LIBDIR /usr/lib/redis/modules
ADD . /REJSON
WORKDIR /REJSON
# Set up a build environment
RUN set -ex ;\
mkdir -p deps ;\
cd deps ;\
git clone https://github.com/RedisLabsModules/readies.git
RUN PIP=1 FORCE=1 ./deps/readies/bin/getpy2
RUN ./system-setup.py
# Build the source
RUN set -ex ;\
cargo build --release ;\
mv target/release/librejson.so target/release/rejson.so
#----------------------------------------------------------------------------------------------
# Package the runner
FROM redis:latest
ENV LIBDIR /usr/lib/redis/modules
WORKDIR /data
RUN mkdir -p "$LIBDIR"
COPY --from=builder /REJSON/target/release/rejson.so "$LIBDIR"
CMD ["redis-server", "--loadmodule", "/usr/lib/redis/modules/rejson.so"]