fix(docker): 加固 Compose 默认配置 - #783
Merged
Merged
Conversation
生产环境不发布 PostgreSQL 与 Redis 端口,统一使用 SCRAM 认证。保留可启动的演示密码并支持通过环境变量覆盖,同时同步部署说明与默认配置。
zhou-hao
force-pushed
the
codex/docker-compose-security
branch
from
August 12, 2026 03:53
1846d7b to
59a0a59
Compare
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
目的
核心变动
docker/dev-env:PostgreSQL 使用scram-sha-256,保留 PostgreSQL5432和 Redis6379端口映射供本地调试docker/run-all:移除 PostgreSQL5432和 Redis6379宿主机端口映射,仅保留 JetLinks 对外端口.env.example,并补充 README 部署、密码提示和已有数据迁移说明2.12设计与测试目标
测试结果
docker compose config --quiet:docker/dev-env、docker/run-all均通过postgres、redis端口均为空;开发环境两个端口均保留;两份 Compose 均为scram-sha-256postgres:5432TCP 密码连接成功,角色密码确认为 SCRAM-SHA-2562.11.0-SNAPSHOT镜像、隔离 PostgreSQL/Redis 和临时测试凭据启动成功,完成 R2DBC 初始化且未出现数据库或 Redis 连接/认证错误git diff --check:通过文档同步情况
README.md、docker/dev-env/.env.example、docker/run-all/.env.example风险与说明
.env或环境变量覆盖,未配置时仍可直接启动POSTGRES_PASSWORD环境变量自动修改数据库密码;如需变更请显式执行密码迁移并同步更新配置