Files

79 lines
2.5 KiB
Markdown
Raw Permalink 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.
# 测试服实例配置
> 从 memory/server-workpod-instances.md 迁移,保持同步。
---
## 服务器信息
| 项目 | 值 |
|------|-----|
| 服务器 | flux_dev |
| IP | 39.99.243.191 |
| 配置目录 | /opt/workpod/ |
| 共用镜像 | workpod-alpine:latest (或 workpod-alpine:3.23) |
## 实例列表
| 实例 | SSH 端口 | Web 端口 | 域名 | ttyd 账号 | 备注 |
|------|---------|---------|------|----------|------|
| workpod-1 | 2221 | 7681 | wk.1216.top | jc:1234567 | 默认 entrypoint.sh |
| workpod-alpine | 2222 | 7683 | wk2.1216.top | jc:1234567 | 默认 entrypoint.sh |
| workpod-ada | 2224 | 7685 | ada.1216.top | **ada:123** | 独立 ttyd 凭据 |
| workpod-yxl | 2226 | 7686 | yxl.1216.top | **yxl:123** | 独立 entrypoint-yxl.sh |
## 密钥配置
ada 和 yxl 的 Claude Code 密钥通过 docker-compose environment 注入:
```yaml
environment:
- ANTHROPIC_AUTH_TOKEN=xxx
- ANTHROPIC_BASE_URL=https://open.bigmodel.cn/api/anthropic
- API_TIMEOUT_MS=3000000
- CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC=1
```
workpod-1 和 workpod-alpine 的密钥在 /root/.claude/settings.json 中。
## Nginx 配置
- 配置目录:`/etc/nginx/conf.d/`
- SSL 证书:`/etc/nginx/sslkey/_.1216.top.pem`(通配符证书)
- WebSocket 代理必须配置:
```nginx
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
```
## 更新容器注意事项
1. 镜像更新:`docker load < image.tar` 后逐个修改 compose 的 image tag
2. 脚本更新:entrypoint.sh 是共用的,ttyd-session.sh 是共用的
3. ttyd 账号不同:ada 用 `ada:123`yxl 用 `yxl:123`,其他用 `jc:1234567`
4. 权限:上传脚本后必须 `chmod 755`
5. Docker Compose 版本:测试服用 `docker-compose`v1),不是 `docker compose`
6. 网络:所有实例共用 `workpod-network`
## 部署步骤
```bash
# 1. 上传代码到 /opt/workpod/
scp -r ./workpod/* root@39.99.243.191:/opt/workpod/
# 2. SSH 登录
ssh root@39.99.243.191
# 3. 加载镜像(如有新镜像)
docker load < /opt/workpod/workpod-alpine-latest.tar.gz
# 4. 设置权限
chmod 755 /opt/workpod/entrypoint.sh /opt/workpod/ttyd-session.sh
# 5. 启动各实例
cd /opt/workpod && docker-compose -f docker-compose.yml up -d # workpod-1
cd /opt/workpod && docker-compose -f docker-compose-alpine.yml up -d # workpod-alpine
cd /opt/workpod && docker-compose -f docker-compose-ada.yml up -d # workpod-ada
cd /opt/workpod && docker-compose -f docker-compose-yxl.yml up -d # workpod-yxl
```