fix(deploy): gateway 挂载微信支付证书目录(容器读不到宿主机路径)

证书在 132 宿主机 /home/workspace/wechat-pay-cert,但 gateway 跑在容器里、没挂任何卷,
LoadPrivateKeyWithPath 直接读磁盘 → 路径不存在 → 商户私钥加载失败、微信渠道隐藏。

只读挂进 gateway(只有它碰支付,dispatcher/mcp-* 不用):
  /home/workspace/wechat-pay-cert → /etc/sundynix/wechat-cert (ro)

⚠️ admin「系统配置 → 支付」里填的必须是**容器内路径** /etc/sundynix/wechat-cert/xxx.pem,
填宿主机路径会失败。私钥不进镜像、不进 git。部署时 compose 变更会让 up -d 重建容器生效。

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Blizzard
2026-07-20 10:19:32 +08:00
parent c3151d1078
commit ac4fd00e28
+5
View File
@@ -32,6 +32,11 @@ services:
CORS_ALLOW_ORIGIN: ${CORS_ALLOW_ORIGIN:-*} CORS_ALLOW_ORIGIN: ${CORS_ALLOW_ORIGIN:-*}
OTEL_EXPORTER_OTLP_ENDPOINT: http://192.168.100.128:4318 OTEL_EXPORTER_OTLP_ENDPOINT: http://192.168.100.128:4318
ports: ["3000:8080"] # frp 外网 → 132:3000 → 容器 8080 ports: ["3000:8080"] # frp 外网 → 132:3000 → 容器 8080
volumes:
# 微信支付证书(商户私钥 + 微信支付公钥):宿主机 132 的目录只读挂进容器。
# ⚠️ admin「系统配置 → 支付」里填的路径必须是**容器内路径**/etc/sundynix/wechat-cert/...),
# 不是宿主机路径——容器看不到宿主机的 /home/workspace/...。私钥不进镜像、不进 git。
- /home/workspace/wechat-pay-cert:/etc/sundynix/wechat-cert:ro
dispatcher: dispatcher:
build: { context: ../.., dockerfile: sundynix-dispatcher/Dockerfile } build: { context: ../.., dockerfile: sundynix-dispatcher/Dockerfile }