Files
digital-me-history/DOCKER-LOCAL.md
T
admin 0593ff7e62
nginx serve /uploads direct (audio speed) / patch-nginx (push) Failing after 1m34s
数字我 Digital Me:全量入库(大文件走 Git LFS)
2026-10-10 16:24:43 +08:00

46 lines
1.6 KiB
Markdown
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 Compose
## 启动
1. 启动 Docker Desktop,或执行 `colima start`。
2. 在本目录执行:
```bash
cp .env.docker.example .env.docker
docker compose --env-file .env.docker up --build -d
```
本机浏览器打开:<http://localhost:8080>
同一局域网内的手机或电脑打开:<http://192.168.110.3:8080>
局域网 IP 可能在重新连接 Wi-Fi 后变化。可在 Mac 上执行以下命令查看当前地址,
并同步修改 `.env.docker` 中的 `PUBLIC_URL`、`CORS_ORIGINS` 和 `WEB_BASE_URL`:
```bash
ipconfig getifaddr en0
```
后端健康检查:<http://localhost:8080/health>
## 常用命令
```bash
docker compose --env-file .env.docker ps
docker compose --env-file .env.docker logs -f backend web mongo
docker compose --env-file .env.docker down
```
数据默认保存在 Docker named volumes 中。普通 `down` 不会删除数据;只有显式执行
`docker compose down -v` 才会删除本地 MongoDB 与上传数据。
## 本地模式说明
- MongoDB、后端、前端/Nginx 共三个容器。
- 前端 `8080` 端口监听局域网;Nginx 将同源 API、WebSocket 和上传资源转发给后端。
- 后端 `3701` 端口仍只监听本机,MongoDB 不对宿主机或局域网开放。
- 如果 macOS 防火墙首次询问是否允许传入连接,需要选择“允许”。
- 未填写 AI Key 时,相关能力按现有代码降级;历史浏览等不依赖 AI Key 的能力仍可测试。
- 本地启用了 stub 登录和 stub 支付,只可用于开发验证。
- ECS 部署前必须改为强随机 JWT 密钥、关闭 stub 登录,并配置真实域名、HTTPS、备份与对象存储。