Files
wecom-ai-assistant/PRIVATE_REPO_SETUP.md
bujie9527 2f1090f7cc Add private repo setup summary
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-05 20:09:32 +08:00

105 lines
2.1 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# 私有仓库配置完成
## ✅ 配置状态
- ✅ Git 私有仓库已配置
- ✅ Docker Registry 已配置并测试连接
- ✅ 配置文件已创建
- ✅ 脚本已创建
## 📋 配置信息
### Git 仓库
- **远程名称**: `private`
- **仓库地址**: https://git.quanyu360.cn/admin/wecom-ai-assistant.git
- **用户名**: admin
- **密码**: 已配置
### Docker Registry
- **Registry URL**: git.quanyu360.cn
- **用户名**: admin
- **密码**: 已配置在 `.registry-config`
- **命名空间**: wecom-ai
## 🚀 使用方法
### 1. 推送代码到私有仓库
```powershell
# 推送到私有仓库(默认)
git push private main
# 推送到 GitHub
git push origin main
# 推送到两个仓库
git push private main
git push origin main
```
### 2. 推送 Docker 镜像
```powershell
# 测试 Registry 连接
docker login git.quanyu360.cn -u admin -p ye972030
# 构建并推送 Backend 镜像
docker build -f deploy/docker/backend.Dockerfile -t git.quanyu360.cn/wecom-ai/wecom-ai-backend:latest .
docker push git.quanyu360.cn/wecom-ai/wecom-ai-backend:latest
# 构建并推送 Admin 镜像
docker build -f deploy/docker/admin.Dockerfile -t git.quanyu360.cn/wecom-ai/wecom-ai-admin:latest .
docker push git.quanyu360.cn/wecom-ai/wecom-ai-admin:latest
```
### 3. 使用私有镜像部署
更新 `.env.prod`
```bash
REGISTRY_URL=git.quanyu360.cn
REGISTRY_NAMESPACE=wecom-ai
IMAGE_TAG=latest
```
在生产服务器上登录:
```bash
docker login git.quanyu360.cn -u admin -p ye972030
```
然后部署:
```bash
docker-compose -f docker-compose.prod.yml --env-file .env.prod up -d
```
## 📝 配置文件
- `.registry-config` - Docker Registry 配置(不提交到 Git
- `.registry-config.example` - 配置模板(可提交)
## 🔍 验证
### 检查 Git 远程仓库
```powershell
git remote -v
```
应该看到:
- `origin` → GitHub
- `private` → 私有仓库
### 测试 Docker Registry
```powershell
docker login git.quanyu360.cn -u admin -p ye972030
```
## 📚 详细文档
查看 `docs/private-registry-setup.md` 获取完整配置指南。