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:
@@ -85,6 +85,7 @@ docker-compose up -d --build
|
||||
- `web`:前端静态站点,暴露 `http://localhost:4002` 和 `https://localhost:4443`。
|
||||
- `api`:NestJS API,暴露 `http://localhost:3002`。
|
||||
- `db`:PostgreSQL 16,暴露 `localhost:5433`。
|
||||
- `frpc`:`# XXX` 可选公网隧道客户端,通过 `--profile frpc` 启用,读取 `frpc/frpc.toml` 把本机 `4002` 映射到公网 frps。
|
||||
- `uploads_data`:后端文件持久化 volume。
|
||||
|
||||
`api` 容器启动时默认会等待数据库健康,执行 `prisma migrate deploy` 和 `prisma db seed`,再启动 NestJS API。可通过 `RUN_DB_MIGRATIONS` 和 `RUN_DB_SEED` 关闭自动初始化。
|
||||
@@ -120,7 +121,10 @@ docker-compose up -d --build
|
||||
export SESSION_SECRET="替换为足够长的随机字符串"
|
||||
export SESSION_COOKIE_SECURE="true"
|
||||
export TRUST_PROXY="true"
|
||||
docker-compose up -d --build
|
||||
|
||||
# XXX 先编辑 frpc/frpc.toml,替换 serverAddr 和 auth.token,再启用 frpc profile。
|
||||
docker-compose --profile frpc up -d --build
|
||||
docker-compose logs -f frpc
|
||||
```
|
||||
|
||||
Nginx Proxy Manager 代理 `sstwbg.example.com` 时:
|
||||
@@ -130,6 +134,8 @@ Nginx Proxy Manager 代理 `sstwbg.example.com` 时:
|
||||
- 绑定 SSL 证书并开启 `Force SSL`,否则浏览器不会开放公网麦克风权限。
|
||||
- Advanced 中建议设置 `client_max_body_size 100m;`、`proxy_read_timeout 3600s;`、`proxy_send_timeout 3600s;`。
|
||||
|
||||
`# XXX` 公网正式访问只映射 `4002` 即可;不要把 Docker 自签名 HTTPS 演示入口 `4443` 映射到公网域名。
|
||||
|
||||
## 麦克风访问
|
||||
|
||||
浏览器不允许普通局域网 HTTP 页面调用麦克风,代码无法绕过这个限制。Docker 演示环境建议使用:
|
||||
|
||||
Reference in New Issue
Block a user