baodan/frontend/docker启动.mc

361 lines
6.2 KiB
MonkeyC
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.

** Docker ** `python` `pnpm dev`
```powershell
cd D:\work\code\python\coding\baodanagent
```
---
## 1. Docker Desktop
Docker Desktop Docker Desktop
```powershell
Start-Process "C:\Program Files\Docker\Docker\Docker Desktop.exe"
```
Docker
```powershell
docker info
```
`Server` Docker
---
## 2.
`python -m insurance.app` `pnpm dev` `5001``5173`
```powershell
$ports = 5001,5173
$ownerIds = Get-NetTCPConnection -LocalPort $ports -ErrorAction SilentlyContinue |
Where-Object { $_.State -eq 'Listen' } |
Select-Object -ExpandProperty OwningProcess -Unique
foreach ($ownerId in $ownerIds) {
if ($ownerId -and $ownerId -ne $PID) {
Stop-Process -Id $ownerId -Force -ErrorAction SilentlyContinue
Write-Output "Stopped local process $ownerId"
}
}
```
Docker `5173``5173` Vite
---
## 3. BaoDan / Dify
```powershell
docker compose -f docker-compose.dify.yml up -d
```
- PostgreSQL
- Redis
- BaoDan API
- BaoDan Web
- Worker
- Plugin Daemon
- Sandbox
---
## 4.
```powershell
docker compose -f docker-compose.frontend.yml up -d
```
Vue
---
## 5.
使
```powershell
docker compose -f docker-compose.dify.yml restart
docker compose -f docker-compose.frontend.yml restart
```
---
## 6.
### BaoDan / Dify
```powershell
docker compose -f docker-compose.dify.yml up -d --build
```
###
```powershell
docker compose -f docker-compose.frontend.yml up -d --build
```
---
## 7.
```powershell
docker ps --format "table {{.Names}}\t{{.Status}}\t{{.Ports}}"
```
```text
baodanagent-baodanagent-web-1 Up ... 0.0.0.0:9080->8080/tcp
baodanagent-baodan-api-1 Up ... 0.0.0.0:5001->5001/tcp
baodanagent-baodan-web-1 Up ... 0.0.0.0:3000->3000/tcp
baodanagent-baodan-worker-1 Up ...
baodanagent-plugin_daemon-1 Up ... 0.0.0.0:5002-5003->5002-5003/tcp
baodanagent-db-1 Up ... 0.0.0.0:5433->5432/tcp
baodanagent-redis-1 Up ... 0.0.0.0:6380->6379/tcp
baodanagent-sandbox-1 Up ...
```
---
## 8. 访
###
```text
http://localhost:9080/
```
访
```text
http://192.168.1.17:9080/
```
---
### BaoDan / Dify
```text
http://localhost:3000/
```
```text
http://localhost:3000/apps
```
访
```text
http://192.168.1.17:3000/
```
---
### API
```text
http://localhost:5001
```
访
```text
http://192.168.1.17:5001
```
```text
http://localhost:5001/health
```
```json
{"pid":84,"status":"ok","version":"1.14.2"}
```
---
## 9.
###
```powershell
curl.exe -I --max-time 15 http://localhost:9080/
```
```text
HTTP/1.0 200 OK
```
---
### BaoDan
```powershell
curl.exe -I --max-time 15 http://localhost:3000/apps
```
```text
HTTP/1.1 200 OK
```
---
###
```powershell
curl.exe --max-time 15 http://localhost:5001/health
```
```json
{"pid":84,"status":"ok","version":"1.14.2"}
```
---
###
```powershell
curl.exe --max-time 15 http://localhost:5001/insurance/agents/list
```
```json
{
"code": 0,
"data": [
{
"name": "保险智能客服",
"mode": "chat"
}
]
}
```
---
## 10.
### BaoDan API
```powershell
docker logs -f baodanagent-baodan-api-1
```
###
```powershell
docker logs -f baodanagent-baodanagent-web-1
```
### BaoDan
```powershell
docker logs -f baodanagent-baodan-web-1
```
### Worker
```powershell
docker logs -f baodanagent-baodan-worker-1
```
###
```powershell
docker logs -f baodanagent-db-1
```
---
## 11.
```powershell
docker compose -f docker-compose.frontend.yml down
docker compose -f docker-compose.dify.yml down
```
---
## 12.
`-v`
```powershell
docker compose -f docker-compose.dify.yml down -v
```
`-v` Redis Docker volume
---
## 13.
```powershell
cd D:\work\code\python\coding\baodanagent
docker info
docker compose -f docker-compose.dify.yml up -d
docker compose -f docker-compose.frontend.yml up -d
docker ps --format "table {{.Names}}\t{{.Status}}\t{{.Ports}}"
curl.exe --max-time 15 http://localhost:5001/health
curl.exe -I --max-time 15 http://localhost:9080/
curl.exe -I --max-time 15 http://localhost:3000/apps
```
---
## 14.
| | |
|---|---|
| | `http://localhost:9080/` |
| BaoDan / Dify | `http://localhost:3000/` |
| BaoDan / Dify Apps | `http://localhost:3000/apps` |
| API | `http://localhost:5001` |
| | `http://localhost:5001/health` |
| | `http://localhost:5001/insurance/agents/list` |
| PostgreSQL | `localhost:5433` |
| Redis | `localhost:6380` |
| Plugin Daemon | `localhost:5002` |
| Plugin Remote Install | `localhost:5003` |