Unverified Commit cda1c307 authored by Abhishek Dubey's avatar Abhishek Dubey Committed by GitHub

Added support for redis 7 (#15)

Signed-off-by: default avatariamabhishek-dubey <abhishekbhardwaj510@gmail.com>
Signed-off-by: default avatariamabhishek-dubey <abhishekbhardwaj510@gmail.com>
parent 662e516d
......@@ -41,10 +41,14 @@ COPY setupMasterSlave.sh /usr/bin/setupMasterSlave.sh
COPY healthcheck.sh /usr/bin/healthcheck.sh
RUN chown -R redis:redis /etc/redis
VOLUME ["/data"]
WORKDIR /data
EXPOSE 6379
USER 1000
ENTRYPOINT ["/usr/bin/entrypoint.sh"]
......@@ -19,10 +19,12 @@ common_operation() {
set_redis_password() {
if [[ -z "${REDIS_PASSWORD}" ]]; then
echo "Redis is running without password which is not recommended"
echo "protected-mode no" >> /etc/redis/redis.conf
else
{
echo masterauth "${REDIS_PASSWORD}"
echo requirepass "${REDIS_PASSWORD}"
echo protected-mode yes
} >> /etc/redis/redis.conf
fi
}
......@@ -37,12 +39,8 @@ redis_mode_setup() {
echo cluster-config-file "${DATA_DIR}/nodes.conf"
} >> /etc/redis/redis.conf
if [[ "${REDIS_MAJOR_VERSION}" != "v7" ]]; then
if [[ -z "${POD_IP}" ]]; then
POD_IP=$(hostname -i)
fi
sed -i -e "/myself/ s/[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}/${POD_IP}/" "${DATA_DIR}/nodes.conf"
fi
POD_IP=$(hostname -i)
sed -i -e "/myself/ s/[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}/${POD_IP}/" "${DATA_DIR}/nodes.conf"
else
echo "Setting up redis in standalone mode"
fi
......
bind 0.0.0.0
protected-mode yes
tcp-backlog 511
timeout 0
tcp-keepalive 300
......
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