Update registry to registry.667788.cool and add build scripts
Some checks failed
Build and Deploy / test-backend (push) Has been cancelled
Build and Deploy / build-backend (push) Has been cancelled
Build and Deploy / build-admin (push) Has been cancelled
Deploy to Production / build-backend (push) Has been cancelled
Deploy to Production / deploy (push) Has been cancelled
Some checks failed
Build and Deploy / test-backend (push) Has been cancelled
Build and Deploy / build-backend (push) Has been cancelled
Build and Deploy / build-admin (push) Has been cancelled
Deploy to Production / build-backend (push) Has been cancelled
Deploy to Production / deploy (push) Has been cancelled
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
153
REGISTRY_667788_SETUP.md
Normal file
153
REGISTRY_667788_SETUP.md
Normal file
@@ -0,0 +1,153 @@
|
||||
# Registry 667788.cool 配置指南
|
||||
|
||||
## Registry 信息
|
||||
|
||||
- **Registry URL**: `registry.667788.cool`
|
||||
- **API 端点**: `https://registry.667788.cool/v2/`
|
||||
- **命名空间**: `wecom-ai`
|
||||
- **镜像地址**:
|
||||
- Backend: `registry.667788.cool/wecom-ai/wecom-ai-backend:latest`
|
||||
- Admin: `registry.667788.cool/wecom-ai/wecom-ai-admin:latest`
|
||||
|
||||
## 构建并推送镜像
|
||||
|
||||
### 方法一:使用脚本(推荐)
|
||||
|
||||
```powershell
|
||||
# 构建并推送所有镜像
|
||||
.\scripts\build-push-registry-667788.ps1
|
||||
```
|
||||
|
||||
### 方法二:手动构建
|
||||
|
||||
#### 1. 构建 Backend 镜像
|
||||
|
||||
```powershell
|
||||
# 构建镜像
|
||||
docker build -f deploy/docker/backend.Dockerfile -t registry.667788.cool/wecom-ai/wecom-ai-backend:latest .
|
||||
|
||||
# 推送镜像
|
||||
docker push registry.667788.cool/wecom-ai/wecom-ai-backend:latest
|
||||
```
|
||||
|
||||
#### 2. 构建 Admin 镜像
|
||||
|
||||
```powershell
|
||||
# 构建镜像
|
||||
docker build -f deploy/docker/admin.Dockerfile -t registry.667788.cool/wecom-ai/wecom-ai-admin:latest .
|
||||
|
||||
# 推送镜像
|
||||
docker push registry.667788.cool/wecom-ai/wecom-ai-admin:latest
|
||||
```
|
||||
|
||||
### 方法三:使用 docker-compose 构建
|
||||
|
||||
```powershell
|
||||
# 设置环境变量
|
||||
$env:REGISTRY_URL = "registry.667788.cool"
|
||||
$env:REGISTRY_NAMESPACE = "wecom-ai"
|
||||
$env:IMAGE_TAG = "latest"
|
||||
|
||||
# 构建并推送(如果 docker-compose 支持)
|
||||
docker-compose -f docker-compose.prod.yml build
|
||||
docker-compose -f docker-compose.prod.yml push
|
||||
```
|
||||
|
||||
## 登录 Registry(如果需要认证)
|
||||
|
||||
```powershell
|
||||
# 如果 Registry 需要认证
|
||||
docker login registry.667788.cool
|
||||
|
||||
# 或使用用户名密码
|
||||
docker login registry.667788.cool -u 用户名 -p 密码
|
||||
```
|
||||
|
||||
## 更新配置
|
||||
|
||||
### 更新 docker-compose.prod.yml
|
||||
|
||||
确保使用新的 Registry:
|
||||
|
||||
```yaml
|
||||
services:
|
||||
backend:
|
||||
image: registry.667788.cool/wecom-ai/wecom-ai-backend:${IMAGE_TAG:-latest}
|
||||
```
|
||||
|
||||
### 更新 .env.prod
|
||||
|
||||
```bash
|
||||
REGISTRY_URL=registry.667788.cool
|
||||
REGISTRY_NAMESPACE=wecom-ai
|
||||
IMAGE_TAG=latest
|
||||
```
|
||||
|
||||
## 在服务器上拉取镜像
|
||||
|
||||
```bash
|
||||
# 登录 Registry(如果需要)
|
||||
docker login registry.667788.cool
|
||||
|
||||
# 拉取镜像
|
||||
docker pull registry.667788.cool/wecom-ai/wecom-ai-backend:latest
|
||||
docker pull registry.667788.cool/wecom-ai/wecom-ai-admin:latest
|
||||
|
||||
# 使用 docker-compose 部署
|
||||
docker-compose -f docker-compose.prod.yml --env-file .env.prod up -d
|
||||
```
|
||||
|
||||
## 验证推送
|
||||
|
||||
推送成功后,可以通过以下方式验证:
|
||||
|
||||
1. **查看本地镜像**:
|
||||
```powershell
|
||||
docker images | grep registry.667788.cool
|
||||
```
|
||||
|
||||
2. **测试拉取**(在另一台机器):
|
||||
```bash
|
||||
docker pull registry.667788.cool/wecom-ai/wecom-ai-backend:latest
|
||||
```
|
||||
|
||||
3. **访问 Registry API**(如果支持):
|
||||
```
|
||||
https://registry.667788.cool/v2/wecom-ai/wecom-ai-backend/tags/list
|
||||
```
|
||||
|
||||
## 故障排查
|
||||
|
||||
### 问题:构建时无法拉取基础镜像
|
||||
|
||||
**解决方案**:
|
||||
1. 配置 Docker 镜像加速(参考 `docs/docker-mirror.md`)
|
||||
2. 或使用代理
|
||||
3. 或使用构建参数指定镜像源:
|
||||
```powershell
|
||||
docker build --build-arg PYTHON_IMAGE=docker.mirrors.ustc.edu.cn/library/python:3.12-slim -f deploy/docker/backend.Dockerfile -t registry.667788.cool/wecom-ai/wecom-ai-backend:latest .
|
||||
```
|
||||
|
||||
### 问题:推送时提示认证失败
|
||||
|
||||
**解决方案**:
|
||||
```powershell
|
||||
# 登录 Registry
|
||||
docker login registry.667788.cool
|
||||
|
||||
# 重新推送
|
||||
docker push registry.667788.cool/wecom-ai/wecom-ai-backend:latest
|
||||
```
|
||||
|
||||
### 问题:推送时提示权限不足
|
||||
|
||||
**解决方案**:
|
||||
1. 确认用户名和密码正确
|
||||
2. 确认有推送权限
|
||||
3. 检查命名空间是否正确
|
||||
|
||||
## 相关文档
|
||||
|
||||
- [Docker 镜像加速配置](./docs/docker-mirror.md)
|
||||
- [私有仓库配置](./docs/private-registry-setup.md)
|
||||
- [宝塔面板配置](./docs/baota-docker-setup.md)
|
||||
Reference in New Issue
Block a user