fix(docker): 修改 Redis 配置以支持可选的密码设置

This commit is contained in:
shaw
2026-01-09 17:28:31 +08:00
parent 5d1badfe67
commit 27291f2e5f

View File

@@ -173,11 +173,12 @@ services:
volumes:
- redis_data:/data
command: >
sh -c '
redis-server
--save 60 1
--appendonly yes
--appendfsync everysec
${REDIS_PASSWORD:+--requirepass ${REDIS_PASSWORD}}
${REDIS_PASSWORD:+--requirepass "$REDIS_PASSWORD"}'
environment:
- TZ=${TZ:-Asia/Shanghai}
# REDISCLI_AUTH is used by redis-cli for authentication (safer than -a flag)