From be74deae73f19e35919b49eae63dc0a5b503a415 Mon Sep 17 00:00:00 2001 From: Nick <126941599+coo1white@users.noreply.github.com> Date: Fri, 17 Jul 2026 21:04:47 +0700 Subject: [PATCH] fix(deploy): make the redis command flags take effect The redis command is one quoted script given to the inner `sh -c`. Docker compose keeps the newlines inside the quoted string, so `redis-server` on the first line ran as a complete command with no flags at all, and --save / --appendonly / --appendfsync after it were silently never applied (`redis-cli CONFIG GET appendonly` said "no"). Trailing `\` line continuations fold the script back into one command. Checked with redis:7-alpine: appendonly is now "yes" and save is "60 1". --- deploy/docker-compose.yml | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/deploy/docker-compose.yml b/deploy/docker-compose.yml index 6aecdcfa5..05cce430d 100644 --- a/deploy/docker-compose.yml +++ b/deploy/docker-compose.yml @@ -241,12 +241,16 @@ services: hard: 100000 volumes: - redis_data:/data + # The command is one quoted script for the inner `sh -c`. Compose keeps + # the newlines inside the quoted string, so every line needs a trailing + # `\` — without it, `redis-server` on the first line runs with no flags + # at all, and the --save/--appendonly/--appendfsync lines are never read. command: > sh -c ' - redis-server - --save 60 1 - --appendonly yes - --appendfsync everysec + redis-server \ + --save 60 1 \ + --appendonly yes \ + --appendfsync everysec \ ${REDIS_PASSWORD:+--requirepass "$REDIS_PASSWORD"}' environment: - TZ=${TZ:-Asia/Shanghai}