feat: 更新 Docker Compose 配置以绑定 PostgreSQL 端口到 localhost
- 修改 docker-compose.yml,将 PostgreSQL 端口绑定到 localhost,以便通过 SSH 隧道访问,增强安全性。
This commit is contained in:
@@ -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}
|
||||
|
||||
Reference in New Issue
Block a user