Skip to content

Commit 508f713

Browse files
authored
Allow to disable the automatic rdb snapshot in valkey (#403)
* Allow to disable the automatic rdb snapshot in valkey By default, Valkey dumps regularly a snapshot, on testing/demo environnment, we may want to avoid the extra fs pressure * Rename ENABLE to DISABLE for REDIS_SNAPSHOT
1 parent c233f55 commit 508f713

2 files changed

Lines changed: 10 additions & 2 deletions

File tree

docker-compose.yml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,16 +23,22 @@ services:
2323
restart: always
2424
command: |
2525
sh -c '
26+
if [ "$${DISABLE_REDIS_SNAPSHOT}" = "true" ] ; then
27+
redis_snapshot="--save \"\""
28+
else
29+
redis_snapshot=""
30+
fi
2631
if [ "$${ENABLE_REDIS_EMPTY_PASSWORD:-false}" = "true" ]; then
27-
exec valkey-server
32+
exec valkey-server $${redis_snapshot}
2833
else
29-
exec valkey-server --requirepass "$${REDIS_PASSWORD:-redispassword}"
34+
exec valkey-server --requirepass "$${REDIS_PASSWORD:-redispassword}" $${redis_snapshot}
3035
fi
3136
'
3237
environment:
3338
- "ENABLE_REDIS_EMPTY_PASSWORD=${ENABLE_REDIS_EMPTY_PASSWORD:-false}"
3439
- "REDIS_PASSWORD=${REDIS_PASSWORD:-redispassword}"
3540
- "TZ=${TZ:-UTC}"
41+
- "DISABLE_REDIS_SNAPSHOT=${DISABLE_REDIS_SNAPSHOT:-false}"
3642
healthcheck:
3743
test: |
3844
sh -c '

template.env

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,8 @@ SYNCSERVERS_1_PULL_RULES=
146146
# REDIS_PASSWORD=
147147
# Enable passwordless Redis connection (defaults to false for security)
148148
# ENABLE_REDIS_EMPTY_PASSWORD=false
149+
# Disable automatic snapshot dump to disk (defaults to false)
150+
# DISABLE_REDIS_SNAPSHOT=false
149151

150152
# These variables allows overriding some MISP email values.
151153
# They all default to ADMIN_EMAIL.

0 commit comments

Comments
 (0)