Commit 2db31f27 by luoqi

fix(deploy): 托管环境 web/service/docs 绑 0.0.0.0(远端网关经私网 IP 到达)

friday 生产经独立网关 lb1.friday.tech 转发,网关走 ECS 私网 IP 到达应用;base compose 绑
127.0.0.1(本机代理型部署用)会让网关连不上 → 502。之前生产容器是旧 compose 的 0.0.0.0,
force-recreate 应用了 loopback 绑定才暴露此问题。managed override(仅托管环境叠加)用 !override
改回 0.0.0.0;安全由云安全组保证(只放行网关/VPC)。

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
parent 189bdee1
Pipeline #3392 failed in 0 seconds
...@@ -19,6 +19,19 @@ services: ...@@ -19,6 +19,19 @@ services:
redis: redis:
profiles: ["bundled-db-off"] profiles: ["bundled-db-off"]
# 端口绑定:托管环境经【远端网关】(如 friday 的 lb1.friday.tech,独立主机)转发,
# 网关走 ECS 私网 IP 到达应用 → 必须绑 0.0.0.0(非 loopback),否则网关连不上 → 502。
# base compose 绑 127.0.0.1 是给【本机代理型】部署(老/测试机自带 nginx→loopback)用的;
# 那类机器不叠加本 override,仍 127.0.0.1。安全由云安全组保证(只放行网关/VPC,不对公网开)。
pac-web:
ports: !override
- "3100:3100"
# docs 同理(经网关到达);base 绑 127.0.0.1,托管环境需 0.0.0.0,免同样漂移。
pac-docs:
ports: !override
- "3102:3102"
# 迁移容器:去掉对自带 postgres 的依赖,DB 指向托管 # 迁移容器:去掉对自带 postgres 的依赖,DB 指向托管
pac-migrate: pac-migrate:
depends_on: !reset null depends_on: !reset null
...@@ -30,6 +43,8 @@ services: ...@@ -30,6 +43,8 @@ services:
depends_on: !override depends_on: !override
pac-migrate: pac-migrate:
condition: service_completed_successfully condition: service_completed_successfully
ports: !override # 同 pac-web:网关经私网 IP 到达,需绑 0.0.0.0
- "3101:3101"
environment: environment:
DATABASE_URL: ${DATABASE_URL:?托管模式需在 .env 设 DATABASE_URL(指向 RDS)} DATABASE_URL: ${DATABASE_URL:?托管模式需在 .env 设 DATABASE_URL(指向 RDS)}
REDIS_URL: ${REDIS_URL:?托管模式需在 .env 设 REDIS_URL(指向托管 Redis)} REDIS_URL: ${REDIS_URL:?托管模式需在 .env 设 REDIS_URL(指向托管 Redis)}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment