File tree Expand file tree Collapse file tree 2 files changed +12
-1
lines changed Expand file tree Collapse file tree 2 files changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -3,11 +3,13 @@ FROM alpine:3.7
33RUN addgroup -S redis && adduser -S -G redis redis
44RUN apk add --no-cache redis
55
6-
76COPY sentinel.conf /etc/redis/sentinel.conf
7+ COPY entrypoint.sh /docker-entrypoint.sh
88
99ENV PORT=26379
1010ENV REDIS_PORT=6379
1111ENV REDIS_HOST=redis
12+ ENV QUORUM=2
1213
14+ ENTRYPOINT ["/docker-entrypoint.sh" ]
1315CMD ["redis-server" , "/etc/redis/sentinel.conf" , "--sentinel" ]
Original file line number Diff line number Diff line change 1+ #! /bin/sh
2+
3+ sed -i.bak " s/^port .*$/port ${PORT} /" /etc/redis/sentinel.conf
4+ sed -i.bak " s/^\(sentinel monitor [^ ]*\).*$/\1 ${REDIS_HOST} ${REDIS_PORT} ${QUORUM} /" /etc/redis/sentinel.conf
5+ rm /etc/redis/sentinel.conf.bak
6+ chown redis:redis /etc/redis/sentinel.conf
7+ cat /etc/redis/sentinel.conf
8+ echo $@
9+ exec $@
You can’t perform that action at this time.
0 commit comments