-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
79 lines (59 loc) · 2.34 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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
ARG REDIS_VERSION=7.0.12
ARG BUILDER_RUST_VERSION=1.70.0-bookworm
FROM redis:${REDIS_VERSION} AS redis
FROM rust:${BUILDER_RUST_VERSION} AS moduleBuilder
RUN apt clean && apt -y update && apt -y install --no-install-recommends clang && rm -rf /var/lib/apt/lists/*
ARG MODULE_PATH=/usr/lib/redis/modules
RUN mkdir -p ${MODULE_PATH}
COPY --from=redis /usr/local/ /usr/local/
# Python fix for Debian 12 Bookworm
RUN rm /usr/lib/python3.11/EXTERNALLY-MANAGED
# https://github.com/RediSearch/RediSearch
ARG MODULE=RediSearch
ARG VERSION=v2.6.12
WORKDIR /modules
RUN git clone --recursive --depth 1 --branch ${VERSION} https://github.com/${MODULE}/${MODULE}.git
WORKDIR /modules/${MODULE}
# Fix for Python 3.11 (numpy 1.21.6 and nscipy 1.7.3 requires Python < 3.11), affects module tests only
RUN ./deps/readies/bin/getpy3
RUN echo "numpy == 1.25.1\nscipy == 1.9.3" > /modules/RediSearch/tests/pytests/requirements.linux.txt
# BULD
RUN make setup
RUN make fetch SHOW=1
RUN make build SHOW=1 CLANG=1
# RESULT
RUN cp "$(ls -d /modules/${MODULE}/bin/linux-*-release)/search/redisearch.so" ${MODULE_PATH}/redisearch.so
# https://github.com/RedisJSON/RedisJSON
ARG MODULE=RedisJSON
ARG VERSION=v2.4.7
WORKDIR /modules
RUN git clone --depth 1 --branch ${VERSION} https://github.com/${MODULE}/${MODULE}.git
WORKDIR /modules/${MODULE}
# BUILD
RUN cargo build --release
# RESULT
RUN cp /modules/${MODULE}/target/release/librejson.so ${MODULE_PATH}/rejson.so
# https://github.com/RedisTimeSeries/RedisTimeSeries
ARG MODULE=RedisTimeSeries
ARG VERSION=v1.8.11
WORKDIR /modules
RUN git clone --recursive --branch ${VERSION} https://github.com/${MODULE}/${MODULE}.git
WORKDIR /modules/${MODULE}
# BUILD
RUN ./sbin/setup
RUN make build
# RESULT
RUN cp "$(ls -d /modules/${MODULE}/bin/* | head -n 1)/redistimeseries.so" ${MODULE_PATH}/redistimeseries.so
RUN ls -al ${MODULE_PATH}
FROM redis:${REDIS_VERSION}
RUN apt-get update && apt-get install -y openssl && rm -rf /var/lib/apt/lists/*
ARG MODULE_PATH=/usr/lib/redis/modules
# Modules copy
COPY --from=moduleBuilder ${MODULE_PATH}/redisearch.so ${MODULE_PATH}/
COPY --from=moduleBuilder ${MODULE_PATH}/rejson.so ${MODULE_PATH}/
COPY --from=moduleBuilder ${MODULE_PATH}/redistimeseries.so ${MODULE_PATH}/
RUN mkdir -p /usr/local/etc/redis
COPY src /app
RUN mkdir /certs && chown redis:redis /certs
VOLUME /certs
ENTRYPOINT ["/app/start-redis.sh"]