diff --git a/deploy/docker-compose.dev.yml b/deploy/docker-compose.dev.yml index f2acd1ff36..80d9db1785 100644 --- a/deploy/docker-compose.dev.yml +++ b/deploy/docker-compose.dev.yml @@ -147,17 +147,17 @@ services: restart: unless-stopped volumes: - ./redis_data:/data:Z - # 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_PASSWORD:+--requirepass "$REDIS_PASSWORD"}' + command: + - redis-server + - --save + - "60" + - "1" + - --appendonly + - "yes" + - --appendfsync + - everysec + - --requirepass + - ${REDIS_PASSWORD:-} environment: - TZ=${TZ:-Asia/Shanghai} - REDISCLI_AUTH=${REDIS_PASSWORD:-} diff --git a/deploy/docker-compose.local.yml b/deploy/docker-compose.local.yml index 5b6c8d9eb5..672463c4d7 100644 --- a/deploy/docker-compose.local.yml +++ b/deploy/docker-compose.local.yml @@ -264,17 +264,17 @@ services: volumes: # Local directory mapping for easy migration - ./redis_data:/data:Z - # 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_PASSWORD:+--requirepass "$REDIS_PASSWORD"}' + command: + - redis-server + - --save + - "60" + - "1" + - --appendonly + - "yes" + - --appendfsync + - everysec + - --requirepass + - ${REDIS_PASSWORD:-} environment: - TZ=${TZ:-Asia/Shanghai} # REDISCLI_AUTH is used by redis-cli for authentication (safer than -a flag) diff --git a/deploy/docker-compose.yml b/deploy/docker-compose.yml index 1a09032156..3308df0ffe 100644 --- a/deploy/docker-compose.yml +++ b/deploy/docker-compose.yml @@ -287,17 +287,17 @@ 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_PASSWORD:+--requirepass "$REDIS_PASSWORD"}' + command: + - redis-server + - --save + - "60" + - "1" + - --appendonly + - "yes" + - --appendfsync + - everysec + - --requirepass + - ${REDIS_PASSWORD:-} environment: - TZ=${TZ:-Asia/Shanghai} # REDISCLI_AUTH is used by redis-cli for authentication (safer than -a flag)