forked from xiaohei/taiji-AI-PAD
更新前备份
This commit is contained in:
@@ -749,3 +749,4 @@ interface TenantsResourcesSummaryResponse {
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,46 @@
|
||||
# 数据库配置说明
|
||||
|
||||
## 环境区分
|
||||
|
||||
| 环境 | 数据库名 | 配置文件 |
|
||||
|------|----------|----------|
|
||||
| **生产环境 (AKS)** | `taiji` | `k8s/secrets.yaml` |
|
||||
| **测试环境 (docker-compose)** | `postgres` | `.env` 文件 |
|
||||
|
||||
## 生产环境配置 (AKS)
|
||||
|
||||
生产环境通过 `k8s/secrets.yaml` 配置,使用 `taiji` 数据库:
|
||||
|
||||
```yaml
|
||||
database-url: "postgresql://taiji:PASSWORD@taijipda.postgres.database.azure.com:5432/taiji?sslmode=require"
|
||||
async-database-url: "postgresql+asyncpg://taiji:PASSWORD@taijipda.postgres.database.azure.com:5432/taiji"
|
||||
```
|
||||
|
||||
## 测试环境配置 (docker-compose)
|
||||
|
||||
测试环境通过 `.env` 文件配置,使用 `postgres` 数据库:
|
||||
|
||||
```bash
|
||||
# .env 文件配置
|
||||
DATABASE_URL=postgresql://taiji:By%40123456.@taijipda.postgres.database.azure.com:5432/postgres?sslmode=require
|
||||
ASYNC_DATABASE_URL=postgresql+asyncpg://taiji:By%40123456.@taijipda.postgres.database.azure.com:5432/postgres
|
||||
```
|
||||
|
||||
## 配置要点
|
||||
|
||||
1. **生产环境部署到 AKS 时**:
|
||||
- 确保 `k8s/secrets.yaml` 中数据库名为 `taiji`
|
||||
- 通过 `kubectl apply -f k8s/secrets.yaml` 部署
|
||||
|
||||
2. **本地测试环境**:
|
||||
- 在 `.env` 文件中配置数据库名为 `postgres`
|
||||
- 运行 `docker-compose up` 启动服务
|
||||
|
||||
## 数据库信息
|
||||
|
||||
- **服务器地址**: `taijipda.postgres.database.azure.com`
|
||||
- **端口**: `5432`
|
||||
- **用户名**: `taiji`
|
||||
- **SSL模式**: `require`
|
||||
|
||||
|
||||
Reference in New Issue
Block a user