diff --git a/api/docker-compose.yml b/api/docker-compose.yml index ad65777..9471a84 100644 --- a/api/docker-compose.yml +++ b/api/docker-compose.yml @@ -5,8 +5,8 @@ services: postgres: image: postgres:17-alpine container_name: life-echo-postgres - # ports: - # - "5432:5432" # 不暴露到宿主机,仅在 Docker 网络内部访问 + ports: + - "127.0.0.1:5432:5432" # 仅绑定 localhost,通过 SSH 隧道访问 environment: POSTGRES_USER: ${POSTGRES_USER:-postgres} POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-postgres}