Add optional frpc deployment profile
- Add frpc/frpc.toml template for mapping the local Docker web entry on port 4002 to the public frps server. - Add an optional Docker Compose frpc service behind the frpc profile, mounting the reusable frpc.toml configuration. - Document how to enable the frpc profile, inspect frpc logs, and keep normal local startup unchanged. - Clarify that public deployments should map only port 4002 and let Nginx Proxy Manager provide HTTPS for sstwbg.example.com instead of exposing 4443. - Update Docker and deployment docs to match the reusable frpc workflow.
This commit is contained in:
29
README.md
29
README.md
@@ -245,6 +245,7 @@ docker-compose down
|
||||
- Docker 前端同时暴露 `http://localhost:4002` 和自签名证书的 `https://localhost:4443`;麦克风听写建议使用 HTTPS 演示入口。
|
||||
- `api` 服务运行 NestJS 后端,启动时默认执行 `prisma migrate deploy` 和 `prisma db seed`,并把上传文件目录挂载到 `uploads_data` volume。
|
||||
- `db` 服务运行 PostgreSQL 16。
|
||||
- `frpc` 服务是可选公网隧道客户端。`# XXX` 默认通过 Compose profile 关闭,配置文件在 `frpc/frpc.toml`,需要映射到公网服务器时再启用。
|
||||
- `nginx.conf` 已配置 SPA 路由回退、`/api` 反向代理和 `100m` 请求体上限。
|
||||
- `nginx.conf` 已支持 `/api/speech/iat` WebSocket upgrade。
|
||||
完整 Docker 说明见 [docs/docker.md](./docs/docker.md)。
|
||||
@@ -281,18 +282,40 @@ docker-compose up -d --build
|
||||
curl http://127.0.0.1:4002/api/health
|
||||
```
|
||||
|
||||
如果使用 frpc 把本机 `4002` 映射到公网服务器,示例配置如下,端口号按你的 frps 实际开放端口调整:
|
||||
如果使用 frpc 把本机 `4002` 映射到公网服务器,先编辑仓库内置配置:
|
||||
|
||||
```toml
|
||||
# XXX frpc 示例:把本机 Docker 前端入口 4002 暴露到公网服务器的一个内网监听端口。
|
||||
# frpc/frpc.toml
|
||||
# XXX 替换公网 frps 地址和 token;不要把正式 token 提交到仓库。
|
||||
serverAddr = "XX.XX.XX.XX"
|
||||
serverPort = 7000
|
||||
|
||||
auth.method = "token"
|
||||
auth.token = "XXX"
|
||||
|
||||
[[proxies]]
|
||||
name = "surclaw-web"
|
||||
name = "TuWen_System_V2"
|
||||
type = "tcp"
|
||||
localIP = "127.0.0.1"
|
||||
localPort = 4002
|
||||
remotePort = 4002
|
||||
```
|
||||
|
||||
`# XXX` 当前 `docker-compose.yaml` 已内置可选 `frpc` 服务,并使用 `network_mode: host` 让 frpc 容器可以访问本机 `127.0.0.1:4002`。启动完整系统和 frpc:
|
||||
|
||||
```bash
|
||||
docker-compose --profile frpc up -d --build
|
||||
docker-compose logs -f frpc
|
||||
```
|
||||
|
||||
如果只想先启动系统、不启用公网隧道,继续使用:
|
||||
|
||||
```bash
|
||||
docker-compose up -d --build
|
||||
```
|
||||
|
||||
`# XXX` 公网正式访问只需要映射 `4002` 到公网服务器,再由公网 Nginx Proxy Manager 提供 `https://sstwbg.example.com`。不建议把 `4443` 映射到公网域名;`4443` 是本机自签名 HTTPS 演示入口,主要用于 `https://localhost:4443` 测试麦克风。
|
||||
|
||||
Nginx Proxy Manager 中为 `sstwbg.example.com` 新建 Proxy Host:
|
||||
|
||||
- `Domain Names`:`sstwbg.example.com`
|
||||
|
||||
Reference in New Issue
Block a user