a8b0c323989d1aae0512e3591be1d1507bf12382
[ric-plt/dbaas.git] / docker / Dockerfile.redis
1 #   Copyright (c) 2019 AT&T Intellectual Property.
2 #   Copyright (c) 2019 Nokia.
3 #
4 #   Licensed under the Apache License, Version 2.0 (the "License");
5 #   you may not use this file except in compliance with the License.
6 #   You may obtain a copy of the License at
7 #
8 #       http://www.apache.org/licenses/LICENSE-2.0
9 #
10 #   Unless required by applicable law or agreed to in writing, software
11 #   distributed under the License is distributed on an "AS IS" BASIS,
12 #   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 #   See the License for the specific language governing permissions and
14 #   limitations under the License.
15
16 FROM ubuntu:latest
17
18 # Install redis
19 RUN apt update && \
20     apt install -y redis-server && \
21     apt clean
22
23 # Install Redis modules
24 RUN apt install -y build-essential && \
25     apt install -y automake && \
26     apt install -y libtool && \
27     apt clean
28 COPY ./redismodule ./redismodule
29 WORKDIR /redismodule
30 RUN ./autogen.sh && \
31     ./configure && \
32     make install -j
33
34 # Create suitable configuration file
35 RUN sed -i 's/^\(bind .*\)$/# \1/' /etc/redis/redis.conf && \
36     sed -i 's/^\(daemonize .*\)$/# \1/' /etc/redis/redis.conf && \
37     sed 's/^protected-mode yes/protected-mode no/' -i /etc/redis/redis.conf && \
38     echo 'loadmodule /usr/local/libexec/redismodule/libredismodule.so' >> /etc/redis/redis.conf && \
39     sed -i 's/^\(save .*\)$/# \1/' /etc/redis/redis.conf && \
40     echo 'save ""' >> /etc/redis/redis.conf
41
42 EXPOSE 6379
43
44 CMD ["redis-server", "/etc/redis/redis.conf"]