Provide in-network connection details from modules
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 35/100
- Issue 类型
- 功能
- 描述清晰度
- 基本清楚
- 活跃度
- 活跃
- 技术栈
- docker, node.js, typescript
调研方向
Start with #1536 for network alias support and coordinate the getter name with #1538. Read the alias code in packages/testcontainers/src/test-container.ts and started-generic-container.ts, then inspect connection getters under packages/modules/*/src and the in-network listener approaches in Kafka and Redpanda. Done means modules can provide a URI using a network alias and internal port, with credentials and database name from module configuration.
由索引模型根据 Issue 内容生成。
描述
What happens
Module getters return the address as seen from the test process: the Docker host and a mapped port. A second container on the same Docker network needs a different address, the first container's network alias and its internal port, and no module provides it.
const db = await new PostgreSqlContainer(image).withNetwork(network).withNetworkAliases("db").start();
db.getConnectionUri(); // postgres://test:test@localhost:55012/test, no use to another container
const app = await new GenericContainer(appImage)
.withNetwork(network)
.withEnvironment({ DATABASE_URL: "postgres://test:test@db:5432/test" }) // assembled by hand
.start();
The module knows the internal port, the credentials and the database name. The user has to repeat all of them, and keep them in step with the module's defaults.
Expected
Each module can produce its connection details for use inside a network:
db.getConnectionUri({ network }); // postgres://test:test@db:5432/test
A started container can report its aliases on a network, which this needs.
Where
packages/testcontainers/src/test-container.tsandstarted-generic-container.ts, for the aliases- the connection getters in
packages/modules/*/src
Notes
- Kafka and Redpanda already have to deal with in-network listeners. Their approach is a starting point.
- The naming should follow whatever the modules converge on for connection getters.
Dependencies
- Blocked by #1536: needs a started container to know its aliases on a network.
- Coordinate with #1538: for the getter name.
- 主要语言
- TypeScript
- 星标
- 2.6k
- 派生
- 274
- 平均合并
- 1 天 14 小时
- 30 天内合并 PR
- 44
环境准备
在浏览器里用你自己的 GitHub 账号启动这个项目的开发容器。
- 提供 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
testcontainers/testcontainers-node 的其他 Issue
-
enhancement minor
难度 2/5 1-3 小时 新手友好度 74/100
testcontainers/testcontainers-node#1539 ·
维护者通常 1 天内回复
-
enhancement minor
难度 2/5 1-3 小时 新手友好度 82/100
testcontainers/testcontainers-node#1533 ·
维护者通常 1 天内回复
-
enhancement minor
难度 2/5 1-3 小时 新手友好度 77/100
testcontainers/testcontainers-node#1531 ·
维护者通常 1 天内回复
-
enhancement minor
难度 2/5 1-3 小时 新手友好度 76/100
testcontainers/testcontainers-node#1529 ·
维护者通常 1 天内回复
-
enhancement minor
难度 2/5 1-3 小时 新手友好度 78/100
testcontainers/testcontainers-node#1528 ·
维护者通常 1 天内回复
查看 testcontainers/testcontainers-node 的全部 Issue
相似的 Issue
-
community first-timers-only good first issue hacktoberfest help wanted low hanging fruit up-for-grabs
难度 1/5 1 小时以内 新手友好度 70/100
lingdojo/kana-dojo#32590 · 1 条评论 · 5 个 reaction ·
维护者通常 1 天内回复
-
bug p2
难度 2/5 1-3 小时 新手友好度 72/100
bastani-inc/atomic#3703 ·
维护者通常 1 天内回复
-
backend bug difficulty: medium priority: medium reliability
难度 2/5 1-3 小时 新手友好度 76/100
trustflow-protocol/trustflow-backend#730 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 74/100
firecrawl/firecrawl-mcp-server#548 ·
维护者通常 1 天内回复
-
bug
难度 1/5 1 小时以内 新手友好度 90/100
维护者通常 1 天内回复