Commit 966c9f33 authored by Shubham Gupta's avatar Shubham Gupta

Image build for the Sentinel Support

parent 609751ff
FROM alpine:3.15 as builder
LABEL VERSION=1.0 \
ARCH=AMD64 \
DESCRIPTION="A production grade performance tuned redis docker image created by Opstree Solutions"
ARG REDIS_DOWNLOAD_URL="http://download.redis.io/"
ARG REDIS_VERSION="stable"
RUN apk add --no-cache su-exec tzdata make curl build-base linux-headers bash openssl-dev
RUN curl -fL -Lo /tmp/redis-${REDIS_VERSION}.tar.gz ${REDIS_DOWNLOAD_URL}/redis-${REDIS_VERSION}.tar.gz && \
cd /tmp && \
tar xvzf redis-${REDIS_VERSION}.tar.gz && \
cd redis-${REDIS_VERSION} && \
make && \
make install BUILD_TLS=yes
FROM alpine:3.15
LABEL VERSION=1.0 \
ARCH=AMD64 \
DESCRIPTION="A production grade performance tuned redis docker image created by Opstree Solutions"
COPY --from=builder /usr/local/bin/redis-cli /usr/local/bin/redis-cli
COPY --from=builder /usr/local/bin/redis-sentinel /usr/local/bin/redis-sentinel
RUN addgroup -S -g 1000 redis && adduser -S -G redis -u 1000 redis && \
apk add --no-cache bash
COPY sentinel.conf /etc/redis/sentinel.conf
COPY entrypoint-sentinel.sh /usr/bin/entrypoint-sentinel.sh
COPY healthcheck.sh /usr/bin/healthcheck.sh
RUN chown -R redis:redis /etc/redis
VOLUME ["/sentinel-data"]
WORKDIR /data
EXPOSE 26379
USER 1000
ENTRYPOINT ["/usr/bin/entrypoint-sentinel.sh"]
#!/bin/bash
EXTERNAL_CONFIG_FILE=${EXTERNAL_CONFIG_FILE:-"/etc/redis/external.conf.d/redis-sentinel-additional.conf"}
external_config() {
echo "include ${EXTERNAL_CONFIG_FILE}" >> /etc/redis/sentinel.conf
}
start_sentinel() {
echo "Starting redis sentinel service in standalone mode....."
redis-sentinel /etc/redis/sentinel.conf
}
main_function() {
if [[ -f "${EXTERNAL_CONFIG_FILE}" ]]; then
external_config
fi
start_sentinel
}
main_function
\ No newline at end of file
protected-mode no
port 26379
daemonize no
pidfile /var/run/redis-sentinel.pid
logfile ""
dir /tmp
acllog-max-len 128
# sentinel monitor mymaster 127.0.0.1 6379 2
# sentinel down-after-milliseconds mymaster 30000
# sentinel parallel-syncs mymaster 1
# sentinel failover-timeout mymaster 180000
sentinel deny-scripts-reconfig yes
SENTINEL resolve-hostnames no
SENTINEL announce-hostnames no
# SENTINEL master-reboot-down-after-period mymaster 0
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment