build: pass module proxy to docker builder

This commit is contained in:
dela
2026-05-24 21:40:23 +08:00
parent 542eeefdbd
commit 6f4e7f04cc
6 changed files with 34 additions and 2 deletions

View File

@@ -230,6 +230,7 @@ grep -rn --include="*.go" "float64\|float32" internal/entity
- `.dockerignore` 必须排除 `.env``.env.*`,防止 `Dockerfile``COPY . .` 把 secrets 送进 build context / builder layer。
- app 容器内端口固定为 8080宿主机暴露端口只通过 `APP_HOST_PORT` 调整。不要在 compose 中用 `${APP_PORT}` 同时控制容器内监听和宿主机映射。
- app 必须等待 Postgres healthcheck 通过、migration init container 成功退出后再启动。
- Docker build 阶段必须显式传入 `GOPROXY` / HTTP(S) proxy build args`go mod download` 失败必须立刻失败,禁止 `go mod download || true`
**为什么**:这个服务虽然不接 Binance 私钥,但 DB 密码和代理凭据仍可能出现在 `.env`。同时 app 启动前若表不存在,会导致 collector/API 失败;端口变量混用会让健康检查和端口映射分叉。