Skip to content

Commit d3a9c96

Browse files
committed
feat(redis): set appendonly from environment
1 parent 27233b5 commit d3a9c96

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

config/scripts/server-entrypoint.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ function leader_ip {
66

77
REDIS_USER_ID=${REDIS_USER_ID:-100}
88
REDIS_GROUP_ID=${REDIS_GROUP_ID:-101}
9+
APPENDONLY=${APPENDONLY:-yes}
910

1011
chown $REDIS_USER_ID:$REDIS_GROUP_ID /usr/local/etc/redis/redis.conf
1112

@@ -15,7 +16,7 @@ my_ip=$(/opt/redis/scripts/giddyup ip myip)
1516
master_ip=$(leader_ip $stack_name redis)
1617

1718
sed -i -E "s/^ *bind +.*$/bind 0.0.0.0/g" /usr/local/etc/redis/redis.conf
18-
sed -i -E "s/^ *appendonly +.*$/appendonly yes/g" /usr/local/etc/redis/redis.conf
19+
sed -i -E "s/^ *appendonly +.*$/appendonly $APPENDONLY/g" /usr/local/etc/redis/redis.conf
1920
sed -i -E "s/^ *# +masterauth +(.*)$/masterauth $REDIS_PASSWORD/g" /usr/local/etc/redis/redis.conf
2021
sed -i -E "s/^ *# +requirepass +(.*)$/requirepass $REDIS_PASSWORD/g" /usr/local/etc/redis/redis.conf
2122

0 commit comments

Comments
 (0)