Commit Graph

13 Commits

Author SHA1 Message Date
hailin 8e2c44edd0 feat(deploy): add rebuild command with --no-cache support
Add do_rebuild function to rebuild Docker images without cache.
Supports rebuilding individual services or all services at once.

Usage:
  ./deploy.sh rebuild conversation  # rebuild single service
  ./deploy.sh rebuild all           # rebuild all services

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-24 18:40:36 -08:00
hailin aaf43155d9 fix(deploy): include nginx and kong in full-reset
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-24 18:27:39 -08:00
hailin a54b82cab3 fix(deploy): full-reset now only resets data, not rebuild
- Remove image deletion and rebuild steps
- Only delete database volumes and restart services
- TypeORM synchronize:true handles schema creation
- Much faster: no recompilation needed

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-24 08:16:07 -08:00
hailin b70035ad2f fix(migration): add production migration support for Docker
- Add data-source.prod.ts for compiled JS migrations
- Add migration:run:prod script to package.json
- Update deploy.sh to try prod migration first, fallback to dev
- Keep SQL fallback in full-reset as safety net with proper indexes

This ensures migrations work in Docker where ts-node may not be available.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-24 08:05:14 -08:00
hailin 90917b3ac8 fix(deploy): add V2 consulting columns in full-reset
- Add SQL to create consulting_stage, consulting_state, collected_info,
  recommended_programs, conversion_path, device_info columns
- Runs after migration step in full-reset to ensure V2 features work

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-24 08:02:35 -08:00
hailin 15ff2f1c3c feat(deploy): add full-reset command for complete system reset
- Add do_full_reset function that deletes all data and rebuilds system
- Preserves SSL certificates (stored in /etc/letsencrypt/)
- Requires explicit YES confirmation before proceeding
- Includes: stop services, clean Docker, rebuild, migrate, restart

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-24 07:17:56 -08:00
hailin 8b99021e0e feat(deploy): auto-init database with pgvector support
- Change PostgreSQL image from postgres:15-alpine to pgvector/pgvector:pg15
- Add init_database() function to auto-detect and initialize database
- Add 'db init' command for manual database initialization
- Database init runs automatically on first 'start all' deployment
- Includes admin account creation and pgvector extension verification

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-23 04:28:51 -08:00
hailin 632e27213a fix(deploy): update start_kong for DB-less mode
Kong is configured to use DB-less mode with declarative config
(kong/kong.yml), so remove the obsolete kong-database and
migrations steps from the deploy script.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-23 04:10:35 -08:00
hailin f273e7be8d feat: 傻瓜式nginx反向代理配置
- Docker nginx使用8080端口避免与系统nginx冲突
- 启动nginx时自动配置系统nginx反向代理
- 支持Debian/Ubuntu和CentOS/RHEL两种配置目录
- 自动测试配置并重载nginx

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-09 07:51:49 -08:00
hailin 8ac2909530 . 2026-01-09 22:39:40 +08:00
hailin ae9b33a491 refactor: 改用 Docker 容器构建,无需在主机安装 Node.js
- 移除对主机 node/pnpm 的依赖,只需要 Docker
- 新增 builder 镜像自动创建功能
- 所有构建操作在容器中执行
- 支持 docker-compose 和 docker compose (V2)
- 使用 pnpm store volume 加速依赖安装

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-09 06:35:05 -08:00
hailin 3ac83e9305 feat: 添加 SSL 证书自动申请和 Kong API Gateway 配置
新增功能:
- deploy.sh 添加 ssl 命令支持 Let's Encrypt 证书自动申请
- deploy.sh 添加 kong 命令支持 API Gateway 路由配置
- deploy.sh 添加 deploy-full 命令一键完整部署(含SSL)
- Nginx 配置更新为 HTTPS,支持 HTTP->HTTPS 重定向
- 域名配置为 iconsulting.szaiai.com

SSL 功能:
- ./deploy.sh ssl install    安装 certbot
- ./deploy.sh ssl obtain     申请证书
- ./deploy.sh ssl renew      续期证书
- ./deploy.sh ssl auto-renew 配置自动续期

Kong 功能:
- ./deploy.sh kong setup     配置所有微服务路由
- ./deploy.sh kong status    查看网关状态
- ./deploy.sh kong services  查看服务列表
- ./deploy.sh kong routes    查看路由列表

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-09 00:07:26 -08:00
hailin a7add8ff90 Initial commit: iConsulting 香港移民咨询智能客服系统
项目架构:
- Monorepo (pnpm + Turborepo)
- 后端: NestJS 微服务 + Claude Agent SDK
- 前端: React + Vite + Ant Design

包含服务:
- conversation-service: 对话服务 (Claude AI)
- user-service: 用户认证服务
- payment-service: 支付服务 (支付宝/微信/Stripe)
- knowledge-service: 知识库服务 (RAG + Neo4j)
- evolution-service: 自我进化服务
- web-client: 用户前端
- admin-client: 管理后台

基础设施:
- PostgreSQL + Redis + Neo4j
- Kong API Gateway
- Nginx 反向代理
- Docker Compose 部署配置

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-09 00:01:12 -08:00