documentdb-local-deployment
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseLocal Deployment & Developer Workflow — Azure DocumentDB
Azure DocumentDB 本地部署与开发者工作流
Image choices:
- Gateway () — MongoDB wire protocol on port 10260. Use this for app development.
ghcr.io/microsoft/documentdb/documentdb-local:latest - psql-only () — raw PostgreSQL on port 9712. Use only for direct SQL inspection.
mcr.microsoft.com/cosmosdb/ubuntu/documentdb-oss:...
镜像选择:
- Gateway()—— 在端口10260上支持MongoDB有线协议。适用于应用开发场景。
ghcr.io/microsoft/documentdb/documentdb-local:latest - 仅psql版本()—— 在端口9712上提供原生PostgreSQL服务。仅用于直接SQL检查场景。
mcr.microsoft.com/cosmosdb/ubuntu/documentdb-oss:...
Rules
规则
- local-choose-deployment-method — Pick the simplest local option (Gateway, Compose, psql-only, or source) that matches the interface your app actually uses.
- local-docker-compose-setup — Reproducible local stack via : pinned images,
docker-compose.yml,host.docker.internal.restart: unless-stopped - local-connection-config — Connect on port 10260 with ,
--tls, and SCRAM-SHA-256 for the self-signed local cert.--tlsAllowInvalidCertificates - local-env-driven-config — Drive connection URI and TLS relaxation from env vars; never default in code.
tlsAllowInvalidCertificates=true - local-sample-data-management — Use +
SKIP_INIT_DATAwith vetted seed scripts; don't ship the built-inINIT_DATA_PATHbeyond local demos.sampledb - local-ports-and-bindings — Bind published ports to and expose only what you use (10260 for Mongo, 9712 for psql).
127.0.0.1 - local-prod-parity — Same connection abstraction and versioned index/seed scripts across local and Azure DocumentDB; integration-test against the real container.
- local-choose-deployment-method — 选择与你的应用实际使用的接口匹配的最简本地部署方案(Gateway、Compose、仅psql版本或源码部署)。
- local-docker-compose-setup — 通过实现可复现的本地栈:固定镜像版本、
docker-compose.yml、host.docker.internal。restart: unless-stopped - local-connection-config — 通过端口10260连接,使用、
--tls参数,针对自签名本地证书采用SCRAM-SHA-256认证。--tlsAllowInvalidCertificates - local-env-driven-config — 通过环境变量驱动连接URI和TLS放宽设置;绝不在代码中默认。
tlsAllowInvalidCertificates=true - local-sample-data-management — 使用+
SKIP_INIT_DATA搭配经过验证的种子脚本;除本地演示外,不要交付内置的INIT_DATA_PATH。sampledb - local-ports-and-bindings — 将发布端口绑定到,仅暴露你实际使用的端口(Mongo用10260,psql用9712)。
127.0.0.1 - local-prod-parity — 在本地环境与Azure DocumentDB之间保持相同的连接抽象和版本化索引/种子脚本;针对真实容器进行集成测试。