Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
d577300
@
mikewoo Jun 5, 2026
28b3f86
@
mikewoo Jun 5, 2026
085b69a
@
mikewoo Jun 5, 2026
25b1f95
feat(db): rewrite V1__init.sql as final-state PostgreSQL 17 schema
mikewoo Jun 5, 2026
b621e9d
docs(db): convert DATABASE.md conventions to PostgreSQL 17
mikewoo Jun 5, 2026
80580b5
feat(provider): translate health upsert to PostgreSQL ON CONFLICT
mikewoo Jun 5, 2026
75a4282
feat(agent): translate agent_knowledge batch upsert to ON CONFLICT
mikewoo Jun 5, 2026
aaa93f4
feat: translate JSON_EXTRACT to PostgreSQL ->> with ::bigint cast
mikewoo Jun 5, 2026
1a79b94
refactor: drop MySQL-only fixDatabase endpoint, clean dialect words i…
mikewoo Jun 5, 2026
b2329de
refactor: single datasource — point vector JdbcTemplate at main PG DB
mikewoo Jun 5, 2026
e86083f
build: drop MySQL/Druid/flyway-mysql deps, remove dual-datasource wor…
mikewoo Jun 5, 2026
bb3c652
config: main datasource to PostgreSQL + HikariCP, merge vector source
mikewoo Jun 5, 2026
79f6f3b
config: replace Druid pool with HikariCP across dev/prod/staging
mikewoo Jun 5, 2026
d620bcc
deploy: drop mysql service, pgvector pg17 hosts single DB
mikewoo Jun 5, 2026
da8308d
test: switch H2 to PostgreSQL mode, IDENTITY/TEXT schema adaptations
mikewoo Jun 5, 2026
ac1cc17
test: fix H2 cross-context contamination and IDENTITY sequence collision
mikewoo Jun 5, 2026
46d3440
test: add Testcontainers PG17 coverage for JSONB/upsert/vector/identity
mikewoo Jun 5, 2026
9892029
ci: add SQL dialect regression guard for PostgreSQL migration
mikewoo Jun 5, 2026
9aeba9e
chore: remove Druid/MySQL dependencies, deduplicate ContextPropagatin…
mikewoo Jun 6, 2026
6f64659
fix(db): clean obsolete SQL files, fix VECTOR/TIMESTAMP types for PG …
mikewoo Jun 6, 2026
bdccbe7
ci: switch CI/CD, K8s config, startup scripts from MySQL to PostgreSQL
mikewoo Jun 6, 2026
61dfd11
docs: update all documentation to PostgreSQL 17 single-database archi…
mikewoo Jun 6, 2026
fc8de60
chore: remove stale MySQL references from Java Javadoc comments
mikewoo Jun 6, 2026
be04c99
chore: bump version to 1.1.0
mikewoo Jun 6, 2026
57a5905
fix(frontend): resolve vue-tsc build errors, extract component types
mikewoo Jun 6, 2026
1ff1637
fix(test): add explicit PG driver to pgtest profile for Testcontainers
mikewoo Jun 6, 2026
6a9a709
fix(test): use custom FlywayConfig in pgtest instead of Spring Boot a…
mikewoo Jun 6, 2026
412639c
fix(test): use 1024-dim vector in PgIntegrationTest to match VECTOR(1…
mikewoo Jun 6, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 4 additions & 24 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -25,21 +25,10 @@ JWT_SECRET=
# 开发环境使用 application-dev.yml 中的默认值,无需设置
CRYPTO_KEK=

# ========== MySQL ==========
MYSQL_HOST=localhost
MYSQL_PORT=3306
MYSQL_DATABASE=eify
MYSQL_USERNAME=root
MYSQL_PASSWORD=change_me_mysql_password

# MySQL root 密码(仅 docker-compose.yml 需要)
# MYSQL_ROOT_PASSWORD=change_me_mysql_root_password

# JDBC URL(可直接覆盖自动拼接的 URL)
# MYSQL_URL=jdbc:mysql://localhost:3306/eify?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true

# ========== Druid 监控面板(仅开发环境) ==========
# DRUID_PASSWORD=admin
# ========== PostgreSQL 17(主数据库,承载业务表 + 向量表) ==========
PG_URL=jdbc:postgresql://localhost:5432/eify?stringtype=unspecified
PG_USERNAME=postgres
PG_PASSWORD=change_me_postgres_password

# ========== Redis ==========
REDIS_HOST=localhost
Expand All @@ -61,15 +50,6 @@ CLICKHOUSE_PASSWORD=change_me_clickhouse_password
# ========== Grafana(日志栈可视化) ==========
GRAFANA_PASSWORD=change_me_grafana_password

# ========== PostgreSQL(pgvector 向量存储) ==========
PGVECTOR_HOST=localhost
PGVECTOR_PORT=5432
PGVECTOR_DATABASE=eify_vector
# 备选:直接指定完整 JDBC URL(优先于上述分离变量)
# PGVECTOR_URL=jdbc:postgresql://localhost:5432/eify_vector?stringtype=unspecified
PGVECTOR_USERNAME=postgres
PGVECTOR_PASSWORD=change_me_postgres_password

# ========== Embedding API(DashScope / OpenAI 兼容) ==========
EMBEDDING_API_KEY=change_me_embedding_api_key

Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ If applicable, add screenshots to help explain the problem.
| **Deployment** | Docker / Local Dev |
| **Browser** | Chrome / Firefox / Edge |
| **Version** | 3.x |
| **Database** | MySQL 8.x |
| **Database** | PostgreSQL 17 |

## Logs

Expand Down
29 changes: 17 additions & 12 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,19 @@ jobs:
runs-on: ubuntu-latest

services:
mysql:
image: mysql:8.0
postgres:
image: pgvector/pgvector:pg17
env:
MYSQL_ROOT_PASSWORD: root
MYSQL_DATABASE: eify
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: eify
ports:
- 3306:3306
options: --health-cmd "mysqladmin ping -h localhost" --health-interval 10s --health-timeout 5s --health-retries 5
- 5432:5432
options: >-
--health-cmd "pg_isready -U postgres"
--health-interval 10s
--health-timeout 5s
--health-retries 5

steps:
- name: Checkout
Expand All @@ -35,9 +40,9 @@ jobs:
- name: Build & Test
run: mvn verify -pl eify-app -am -DskipTests=false
env:
MYSQL_URL: jdbc:mysql://localhost:3306/eify?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true
MYSQL_USERNAME: root
MYSQL_PASSWORD: root
PG_URL: jdbc:postgresql://localhost:5432/eify?stringtype=unspecified
PG_USERNAME: postgres
PG_PASSWORD: postgres
REDIS_HOST: localhost
REDIS_PORT: 6379
EMBEDDING_API_KEY: ${{ secrets.EMBEDDING_API_KEY }}
Expand Down Expand Up @@ -91,9 +96,9 @@ jobs:
- name: Build Backend JAR
run: mvn package -pl eify-app -am -DskipTests
env:
MYSQL_URL: jdbc:mysql://localhost:3306/eify
MYSQL_USERNAME: root
MYSQL_PASSWORD: root
PG_URL: jdbc:postgresql://localhost:5432/eify?stringtype=unspecified
PG_USERNAME: postgres
PG_PASSWORD: postgres

- name: Setup Node
uses: actions/setup-node@v4
Expand Down
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
- 工作流引擎:可视化编排,支持 LLM/API/ToolCall/条件分支/开始/结束节点
- 多工作空间多租户架构:JWT 认证 + 工作空间级数据隔离
- 完整日志系统:纯 JSON 格式(UTC)、ClickHouse + Vector 采集、OpenTelemetry 链路追踪
- Docker 全栈部署:MySQL + Redis + pgvector + ClickHouse + Vector
- Docker 全栈部署:PostgreSQL 17 + Redis + ClickHouse + Vector
- CI/CD:GitHub Actions 自动化测试与构建 + Jenkins CD 部署流水线

---
Expand Down
10 changes: 5 additions & 5 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ mvn spring-boot:run -pl eify-app -Dspring-boot.run.profiles=dev
### Docker 部署

```bash
# 启动所有服务(MySQL + Redis + pgvector + 应用)
# 启动所有服务(PostgreSQL 17 + Redis + 应用)
docker-compose -f deploy/infra/deploy/docker-compose.yml up -d

# 启动日志采集链路(ClickHouse + Vector + Grafana + Prometheus)
Expand Down Expand Up @@ -85,7 +85,7 @@ grep 'YOUR_TRACE_ID' ./logs/eify.log | jq
| 🔴 **日志格式** | 使用统一日志配置,输出纯 JSON 格式(UTC 时区) | 日志格式混乱 | [LOGGING.md](docs/guides/LOGGING.md) |
| 🔴 **ClickHouse 类型** | Nullable 字段不能与 LowCardinality 嵌套 | 类型错误 | [DATABASE.md](docs/guides/DATABASE.md) |
| 🔴 **工作空间数据隔离** | Service 层所有查询/更新/删除必须过滤 `workspace_id`,更新前验证归属。使用 `WorkspaceGuard` 工具类消除样板代码 | 跨工作空间数据泄露/篡改 | [AUTH-WORKSPACE.md](docs/guides/AUTH-WORKSPACE.md) |
| 🔴 **Flyway 迁移幂等** | 所有 DDL 语句必须检查对象是否已存在(ADD COLUMN → INFORMATION_SCHEMA.COLUMNS,ADD INDEX → INFORMATION_SCHEMA.STATISTICS),确保幂等可重入 | 应用启动失败,迁移阻塞 | [DATABASE.md](docs/guides/DATABASE.md) |
| 🔴 **Flyway 迁移幂等** | 所有 DDL 语句必须使用 PG 原生幂等语法(ADD COLUMN IF NOT EXISTS / CREATE INDEX IF NOT EXISTS / DO $$ ... ADD CONSTRAINT),确保幂等可重入 | 应用启动失败,迁移阻塞 | [DATABASE.md](docs/guides/DATABASE.md) |
| 🔴 **ADR 命名规范** | 架构决策记录统一放在 `docs/ADRs/`,文件命名 `ADR-{四位递增序号}-{名称}.md`,序号按创建时间递增 | ADR 命名混乱,查找困难 | — |
| 🔴 **ADR 格式规范** | 所有 ADR 文档必须遵循 `docs/ADRs/ADR-XXXX-Template.md` 模板格式,包含 6 个必填章节:`# Status`、`# Date`、`# Owner`、`# Deciders`、`# Context`、`# Decision`,以及 2 个推荐章节:`## Consequences`、`# Details`。`# Considered Options` 章节列出所有候选方案及其被拒绝原因 | ADR 结构不一致,难以阅读和对比 | `docs/ADRs/ADR-XXXX-Template.md` |
| 🔴 **安全审查** | 涉及安全敏感代码时,审查前必须阅读 [SECURITY.md](docs/guides/SECURITY.md) 系统风险清单 | 遗漏安全检查 | [SECURITY.md](docs/guides/SECURITY.md) |
Expand Down Expand Up @@ -196,7 +196,7 @@ private LocalDateTime updatedAt;
- 软删除字段 `deleted` 必须有索引
- 分页查询优先使用游标分页(针对大表)
- JSON 字段必须添加注释说明结构
- Flyway 迁移必须幂等:DDL 通过 INFORMATION_SCHEMA 检查后执行,模板详见 [DATABASE.md](docs/guides/DATABASE.md)
- Flyway 迁移必须幂等:DDL 使用 PG 原生 `IF NOT EXISTS` 语法(ADD COLUMN / CREATE INDEX / DO $$ ... ADD CONSTRAINT),模板详见 [DATABASE.md](docs/guides/DATABASE.md)

---

Expand Down Expand Up @@ -252,7 +252,7 @@ cd eify-web && npx vue-tsc --noEmit && cd .. # 前端类型检查

- [ ] **索引覆盖**:新查询有对应索引,EXPLAIN 确认无全表扫描
- [ ] **N+1 查询**:禁止循环内逐条查询,使用批量查询或联表查询
- [ ] **Flyway 幂等**:DDL 使用 `INFORMATION_SCHEMA` 检查模板(ADD COLUMN / ADD INDEX / ADD UNIQUE KEY
- [ ] **Flyway 幂等**:DDL 使用 PG 原生幂等语法(ADD COLUMN IF NOT EXISTS / CREATE INDEX IF NOT EXISTS / DO $$ ... ADD CONSTRAINT
- [ ] **ClickHouse 类型**:Nullable 不与 LowCardinality 嵌套;按 logType 设置 Nullable 字段

### 涉及 API 接口时
Expand Down Expand Up @@ -328,7 +328,7 @@ cd eify-web && npx vue-tsc --noEmit && cd .. # 前端类型检查
| [docs/README.md](docs/README.md) | 项目总览 | 了解项目整体情况 |
| [ARCHITECTURE.md](docs/ARCHITECTURE.md) | 架构设计 | 开发新功能前了解模块结构 |
| [API-SPEC.md](docs/API-SPEC.md) | 接口规范 | 设计 API 接口 |
| [DATABASE.md](docs/guides/DATABASE.md) | 数据库规范 | MySQL 建表模板、索引分页、业务表 DDL、ClickHouse 日志库、游标分页优化 |
| [DATABASE.md](docs/guides/DATABASE.md) | 数据库规范 | PostgreSQL 建表模板、索引分页、业务表 DDL、ClickHouse 日志库、游标分页优化 |
| [AUTH-WORKSPACE.md](docs/guides/AUTH-WORKSPACE.md) | 用户认证与工作空间 | 多租户架构、JWT 认证、数据隔离 |
| [DESIGN.md](DESIGN.md) | 设计系统规范 | 生成前端 UI 时参照,包含颜色、字体、间距、组件、布局等视觉令牌 |

Expand Down
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ cp .env.example .env
# 编辑 .env 填入本地配置

# 3. 启动依赖服务
docker-compose -f deploy/infra/deploy/docker-compose.yml up -d mysql redis
docker-compose -f deploy/infra/deploy/docker-compose.yml up -d pgvector redis

# 4. 启动后端
mvn spring-boot:run -pl eify-app -Dspring-boot.run.profiles=dev
Expand Down Expand Up @@ -72,7 +72,7 @@ mvn test
mvn test -pl eify-workflow
```

CI 通过 GitHub Actions Service Container 提供 MySQL 8.0 测试数据库,CD 部署由 Jenkins 流水线完成。本地测试也可通过 `application-test.yml` 配置连接本地数据库。
CI 通过 GitHub Actions Service Container 提供 PostgreSQL 17 测试数据库,CD 部署由 Jenkins 流水线完成。本地测试也可通过 `application-test.yml` 配置连接本地数据库。

## Issue 规范

Expand Down
16 changes: 6 additions & 10 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,8 @@ pipeline {
description: '部署环境(auto = 根据分支/Tag 自动选择;手动触发 prod 部署时请指定 Tag)'
)
string(name: 'TAG_NAME', defaultValue: '', description: 'Git Tag 名称(手动触发生产部署时指定,如 v1.0.0.20260520103045.42)')
string(name: 'MYSQL_HOST', defaultValue: '', description: 'MySQL 主机地址(留空使用 ConfigMap 默认值)')
string(name: 'PG_HOST', defaultValue: '', description: 'PostgreSQL 17 主机地址(留空使用 ConfigMap 默认值)')
string(name: 'REDIS_HOST', defaultValue: '', description: 'Redis 主机地址')
string(name: 'PGVECTOR_HOST', defaultValue: '', description: 'PostgreSQL 主机地址')
booleanParam(name: 'SKIP_TESTS', defaultValue: false, description: '跳过测试阶段')
}

Expand Down Expand Up @@ -127,30 +126,27 @@ pipeline {

// 更新 ConfigMap(替换占位符)
sh """
sed -i 's/<MYSQL_HOST>/${params.MYSQL_HOST ?: 'localhost'}/g' deploy/k8s/configmap.yaml
sed -i 's/<REDIS_HOST>/${params.REDIS_HOST ?: 'localhost'}/g' deploy/k8s/configmap.yaml
sed -i 's/<PGVECTOR_HOST>/${params.PGVECTOR_HOST ?: 'localhost'}/g' deploy/k8s/configmap.yaml
sed -i 's|<PG_HOST>|${params.PG_HOST ?: 'localhost'}|g' deploy/k8s/configmap.yaml
sed -i 's|<REDIS_HOST>|${params.REDIS_HOST ?: 'localhost'}|g' deploy/k8s/configmap.yaml
sed -i 's/SPRING_PROFILES_ACTIVE: "prod"/SPRING_PROFILES_ACTIVE: "${DEPLOY_ENV}"/g' deploy/k8s/configmap.yaml
"""
sh "kubectl apply -f deploy/k8s/configmap.yaml"

// Secret:使用 Jenkins credentials 动态创建
withCredentials([
string(credentialsId: 'mysql-password', variable: 'MYSQL_PASS'),
string(credentialsId: 'pg-password', variable: 'PG_PASS'),
string(credentialsId: 'redis-password', variable: 'REDIS_PASS'),
string(credentialsId: 'jwt-secret', variable: 'JWT_SECRET'),
string(credentialsId: 'crypto-kek', variable: 'CRYPTO_KEK'),
string(credentialsId: 'pgvector-password', variable: 'PGVECTOR_PASS'),
string(credentialsId: 'embedding-api-key', variable: 'EMBEDDING_API_KEY')
]) {
sh """
kubectl create secret generic eify-secret \
--from-literal=MYSQL_USERNAME=root \
--from-literal=MYSQL_PASSWORD=\${MYSQL_PASS} \
--from-literal=PG_USERNAME=postgres \
--from-literal=PG_PASSWORD=\${PG_PASS} \
--from-literal=REDIS_PASSWORD=\${REDIS_PASS} \
--from-literal=JWT_SECRET=\${JWT_SECRET} \
--from-literal=CRYPTO_KEK=\${CRYPTO_KEK} \
--from-literal=PGVECTOR_PASSWORD=\${PGVECTOR_PASS} \
--from-literal=EMBEDDING_API_KEY=\${EMBEDDING_API_KEY} \
-n ${K8S_NAMESPACE} \
--dry-run=client -o yaml | kubectl apply -f -
Expand Down
15 changes: 7 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,8 @@ docker-compose -f deploy/infra/deploy/docker-compose.yml up -d
### Local Development

```bash
# 1. Start dependencies (MySQL + Redis)
docker-compose -f deploy/infra/deploy/docker-compose.yml up -d mysql redis
# 1. Start dependencies (PostgreSQL + Redis)
docker-compose -f deploy/infra/deploy/docker-compose.yml up -d pgvector redis

# 2. Start backend
./start.sh dev
Expand Down Expand Up @@ -167,9 +167,8 @@ docker-compose -f deploy/optional/docker-compose-jaeger.yml up -d
|:---|:---|
| **Backend Framework** | Spring Boot 4.0.6 |
| **ORM** | MyBatis-Plus 3.5.15 |
| **Database** | MySQL 8.0 |
| **Database** | PostgreSQL 17 + pgvector |
| **Cache** | Redis 7 |
| **Vector DB** | PostgreSQL 16 + pgvector |
| **Frontend** | Vue 3.5.17 + TypeScript + Vite |
| **UI Framework** | Element Plus 2.10.2 |
| **State Management** | Pinia 2.3.1 |
Expand Down Expand Up @@ -204,15 +203,15 @@ eify/

```
┌─────────────┐ ┌─────────────┐ ┌──────────────┐
│ Vue 3 │────▶│ Spring Boot│────▶│ MySQL 8
│ Frontend │ │ REST API │ │ Persistence
│ Vue 3 │────▶│ Spring Boot│────▶│ PostgreSQL 17
│ Frontend │ │ REST API │ │ + pgvector
└─────────────┘ └──────┬──────┘ └──────────────┘
┌───────────┼───────────┐
│ │ │
▼ ▼ ▼
┌──────────┐ ┌──────────┐ ┌──────────┐
│ Redis │ │ pgvector │ │ External
│ Redis │ │ LLM/ │ │ ClickHouse
│ Cache │ │ Vector │ │ LLM APIs │
└──────────┘ └──────────┘ └──────────┘
```
Expand All @@ -231,7 +230,7 @@ eify/
| [ARCHITECTURE.md](docs/ARCHITECTURE.md) | Architecture & coding conventions |
| [API-SPEC.md](docs/API-SPEC.md) | API design specification |
| [AUTH-WORKSPACE.md](docs/guides/AUTH-WORKSPACE.md) | Auth & multi-tenant workspace |
| [DATABASE.md](docs/guides/DATABASE.md) | Database design (MySQL + ClickHouse) |
| [DATABASE.md](docs/guides/DATABASE.md) | Database design (PostgreSQL + ClickHouse) |
| [LOGGING.md](docs/guides/LOGGING.md) | Logging system guide |
| [WORKFLOW.md](docs/guides/WORKFLOW.md) | Workflow engine design |
| [DEPLOYMENT.md](docs/DEPLOYMENT.md) | Deployment & CI/CD |
Expand Down
6 changes: 3 additions & 3 deletions README.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -133,8 +133,8 @@ docker-compose -f deploy/infra/deploy/docker-compose.yml up -d
### 本地开发

```bash
# 1. 启动依赖服务(MySQL + Redis)
docker-compose -f deploy/infra/deploy/docker-compose.yml up -d mysql redis
# 1. 启动依赖服务(PostgreSQL + Redis)
docker-compose -f deploy/infra/deploy/docker-compose.yml up -d pgvector redis

# 2. 启动后端
./start.sh dev
Expand Down Expand Up @@ -168,7 +168,7 @@ docker-compose -f deploy/optional/docker-compose-jaeger.yml up -d
|:---|:---|
| **后端框架** | Spring Boot 4.0.6 |
| **ORM** | MyBatis-Plus 3.5.15 |
| **数据库** | MySQL 8.0 |
| **数据库** | PostgreSQL 17 + pgvector |
| **缓存** | Redis 7 |
| **向量数据库** | PostgreSQL 16 + pgvector |
| **前端** | Vue 3.5.17 + TypeScript + Vite |
Expand Down
40 changes: 5 additions & 35 deletions deploy/infra/deploy/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,25 +4,6 @@


services:
mysql:
image: mysql:8.0
container_name: eify-mysql
ports:
- "3306:3306"
environment:
MYSQL_ROOT_PASSWORD: ${MYSQL_PASSWORD:?MYSQL_PASSWORD_required}
MYSQL_DATABASE: eify
volumes:
- mysql-data:/var/lib/mysql

command: --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci
healthcheck:
test: ["CMD", "mysqladmin", "ping", "-h", "localhost"]
interval: 10s
timeout: 5s
retries: 5
restart: unless-stopped

redis:
image: redis:7-alpine
container_name: eify-redis
Expand All @@ -39,14 +20,14 @@ services:
restart: unless-stopped

pgvector:
image: pgvector/pgvector:pg16
image: pgvector/pgvector:pg17
container_name: eify-pgvector
ports:
- "5432:5432"
environment:
POSTGRES_USER: ${PGVECTOR_USERNAME:-postgres}
POSTGRES_PASSWORD: ${PGVECTOR_PASSWORD}
POSTGRES_DB: ${PGVECTOR_DATABASE:-eify_vector}
POSTGRES_DB: ${PG_DATABASE:-eify}
volumes:
- pgvector-data:/var/lib/postgresql/data
healthcheck:
Expand All @@ -67,24 +48,14 @@ services:
SPRING_PROFILES_ACTIVE: prod
JWT_SECRET: ${JWT_SECRET:?JWT_SECRET_required}
CRYPTO_KEK: ${CRYPTO_KEK:?CRYPTO_KEK_required}
MYSQL_HOST: mysql
MYSQL_PORT: 3306
MYSQL_DATABASE: eify
MYSQL_URL: jdbc:mysql://mysql:3306/eify?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true
MYSQL_USERNAME: root
MYSQL_PASSWORD: ${MYSQL_PASSWORD:?MYSQL_PASSWORD_required}
PG_URL: jdbc:postgresql://pgvector:5432/${PG_DATABASE:-eify}?stringtype=unspecified
PG_USERNAME: ${PGVECTOR_USERNAME:-postgres}
PG_PASSWORD: ${PGVECTOR_PASSWORD}
REDIS_HOST: redis
REDIS_PORT: 6379
REDIS_PASSWORD: ${REDIS_PASSWORD}
EMBEDDING_API_KEY: ${EMBEDDING_API_KEY}
PGVECTOR_HOST: ${PGVECTOR_HOST:-pgvector}
PGVECTOR_PORT: ${PGVECTOR_PORT:-5432}
PGVECTOR_DATABASE: ${PGVECTOR_DATABASE:-eify_vector}
PGVECTOR_USERNAME: ${PGVECTOR_USERNAME:-postgres}
PGVECTOR_PASSWORD: ${PGVECTOR_PASSWORD}
depends_on:
mysql:
condition: service_healthy
redis:
condition: service_healthy
pgvector:
Expand All @@ -104,6 +75,5 @@ services:
restart: unless-stopped

volumes:
mysql-data:
redis-data:
pgvector-data:
12 changes: 2 additions & 10 deletions deploy/k8s/configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,21 +13,13 @@ data:
# Default: prod (production)
SPRING_PROFILES_ACTIVE: "prod"

# MySQL - 替换为实际数据库地址
MYSQL_HOST: "<MYSQL_HOST>"
MYSQL_PORT: "3306"
MYSQL_DATABASE: "eify"
# PostgreSQL 17(主数据库,承载业务表 + 向量表)
PG_URL: "jdbc:postgresql://<PG_HOST>:5432/eify?stringtype=unspecified"

# Redis - 替换为实际 Redis 地址
REDIS_HOST: "<REDIS_HOST>"
REDIS_PORT: "6379"
REDIS_DATABASE: "0"

# PostgreSQL (pgvector) - 替换为实际地址
PGVECTOR_HOST: "<PGVECTOR_HOST>"
PGVECTOR_PORT: "5432"
PGVECTOR_DATABASE: "eify_vector"
PGVECTOR_USERNAME: "postgres"

# JVM options - 根据集群资源调整
JAVA_OPTS: "-Xms512m -Xmx1024m -XX:+UseG1GC -XX:MaxGCPauseMillis=200"
Loading
Loading