fix(web): revalidate app assets and rename compose example
This commit is contained in:
1 parent
eff4b0149d
commit
1b08854b25
6 files changed
+25
-10
No files matched your search
@@ -209,26 +209,33 @@ uv run python tools/import_fans_history.py --from-file data.js --days 90
|
||||
|
||||
## 快速部署(Docker)
|
||||
|
||||
仓库根目录已包含 `Dockerfile`、`docker-compose.yml`、`.dockerignore` 和 `config.docker.example.json`。
|
||||
仓库根目录已包含 `Dockerfile`、`compose.example.yml`、`.dockerignore` 和 `config.docker.example.json`。Compose 文件是示例,需要显式指定:
|
||||
|
||||
```powershell
|
||||
# 1. 准备服务器配置;至少填写 B 站 Cookie / Telegram,并保留 /data 绝对路径
|
||||
Copy-Item config.docker.example.json config.json
|
||||
|
||||
# 2. 构建并后台启动
|
||||
docker compose up -d --build
|
||||
docker compose -f compose.example.yml up -d --build
|
||||
|
||||
# 3. 查看日志与健康状态
|
||||
docker compose logs -f
|
||||
docker compose -f compose.example.yml logs -f
|
||||
curl http://127.0.0.1:8080/api/health
|
||||
```
|
||||
|
||||
如果希望省略 `-f`,可以复制为 `compose.yml`(该文件不提交):
|
||||
|
||||
```powershell
|
||||
Copy-Item compose.example.yml compose.yml
|
||||
docker compose up -d --build
|
||||
```
|
||||
|
||||
- 容器执行 `python app.py --config /config/config.json`,同时运行只读 Web、调度和 Telegram;
|
||||
- `config.json` 挂载到 `/config/config.json`,`data/` 挂载到 `/data/`;
|
||||
- 服务器配置需使用 `web.host = 0.0.0.0` 并设置 `web.auth_token`,否则服务拒绝启动;
|
||||
- `storage.database_path` 使用 `/data/app.db`,`storage.backup_dir` 使用 `/data/backup`;
|
||||
- 首次部署可先在本地执行 `uv run python app.py auth --account read` 扫码,再把生成好的 `config.json` 放到服务器;
|
||||
- 也可在容器内扫码:`docker compose run --rm board python app.py auth --account read --no-browser`,二维码会打印在临时文件路径,可用 `docker cp` 取出;
|
||||
- 也可在容器内扫码:`docker compose -f compose.example.yml run --rm board python app.py auth --account read --no-browser`,二维码会打印在临时文件路径,可用 `docker cp` 取出;
|
||||
- 数据卷包含数据库、备份与预览库,建议定期备份 `/data`。
|
||||
|
||||
不使用 Compose 时:
|
||||
|
||||
Reference in new issue
Block a user