From c7a2979f7c336307ee6e828f78b8f7b4164f9892 Mon Sep 17 00:00:00 2001 From: xuqinmin12 Date: Fri, 12 Jun 2026 19:00:48 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20Redis=20=E5=AE=BF=E4=B8=BB=E6=9C=BA?= =?UTF-8?q?=E7=AB=AF=E5=8F=A3=E6=94=B9=E4=B8=BA=20127.0.0.1:REDIS=5FHOST?= =?UTF-8?q?=5FPORT(=E9=BB=98=E8=AE=A416379)=EF=BC=8C=E9=81=BF=E5=85=8D=20W?= =?UTF-8?q?SL2/=E5=B7=B2=E6=9C=89=20Redis=20=E7=AB=AF=E5=8F=A3=E5=86=B2?= =?UTF-8?q?=E7=AA=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docker-compose.infra.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/docker-compose.infra.yml b/docker-compose.infra.yml index 45687e7..c32400c 100644 --- a/docker-compose.infra.yml +++ b/docker-compose.infra.yml @@ -53,9 +53,10 @@ services: - --appendonly yes # 开启 AOF 持久化 - --requirepass ${REDIS_PASSWORD} # 密码(见 config/secrets.env) ports: - # 暴露到宿主机,方便调试 - # 生产环境可注释此行 - - "${REDIS_PORT:-6379}:6379" + # 暴露到宿主机,方便调试(仅本地可达,127.0.0.1 绑定) + # REDIS_HOST_PORT 默认 16379,避免与宿主机原有 Redis / WSL2 端口代理冲突 + # 内部服务始终通过容器名 redis:6379 连接,此端口仅供外部工具调试用 + - "127.0.0.1:${REDIS_HOST_PORT:-16379}:6379" volumes: - ./data/redis:/data # AOF 文件持久化目录 restart: unless-stopped