Skip to content

Commit 90a0b26

Browse files
authored
build: docker 0.3.0 (#273)
* build: docker 0.3.0 * docs: update docs
1 parent 1908538 commit 90a0b26

File tree

8 files changed

+42
-24
lines changed

8 files changed

+42
-24
lines changed

.dockerignore

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,4 @@
1-
logs/*/*
2-
!logs/*/.gitkeep
3-
41
node_modules/
52
pnpm-lock.yaml
63
**/__pycache__
7-
test/*
8-
Videos/*
9-
settings-production.toml
10-
startRecord-production.sh
4+
test/*

.gitignore

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -370,10 +370,6 @@ logs/*/*
370370
node_modules/
371371
pnpm-lock.yaml
372372

373-
# Ignore the production
374-
startRecord-production.sh
375-
settings-production.toml
376-
377373
# Ignore the cookies.json
378374
cookies.json
379375

Dockerfile

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,13 @@ RUN apt-get update && apt-get install -y \
1414
lsof \
1515
curl \
1616
vim \
17+
gcc \
1718
&& pip install --no-cache-dir -r requirements.txt \
1819
&& apt-get clean \
1920
&& rm -rf /var/lib/apt/lists/*
2021

21-
ENV TZ="Asia/Shanghai"
22-
2322
EXPOSE 2233
2423

25-
CMD ["python", "-m", "src.upload.upload"]
24+
ENV TZ="Asia/Shanghai"
25+
26+
CMD ["./start.sh"]

README.md

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ MLLM 模型主要用于自动切片后的切片标题生成,此功能默认关
218218

219219
| Company | Model Name | `image_gen_model` | `API Key` |
220220
|--------------|--------------------------------|-------------------|---------------------------------------------------------------------------------|
221-
| Minimax | image-01 | `minimax` | [minimax_api_key](https://www.minimax.chat/) |
221+
| Minimax | image-01 | `minimax` | [minimax_api_key](https://platform.minimaxi.com/user-center/basic-information/interface-key) |
222222
| Kwai | Kolors | `siliconflow` | [siliconflow_api_key](https://cloud.siliconflow.cn/i/3Szr5BVg) |
223223
| Tencent | Hunyuan | `tencent` | [tencent_secret_id and tencent_secret_key](https://console.cloud.tencent.com/cam/capi) |
224224
| Baidu | ERNIE irag-1.0 | `baidu` | [baidu_api_key](https://console.bce.baidu.com/iam/key/list) |
@@ -301,7 +301,7 @@ python -m bilitool.cli login
301301

302302
```
303303
logs # 日志文件夹
304-
├── blrec # blrec 录制日志
304+
├── record # blrec 录制日志
305305
│ └── ...
306306
├── scan # scan 处理日志 [debug]级别
307307
│ └── ...
@@ -316,18 +316,22 @@ logs # 日志文件夹
316316
> [!IMPORTANT]
317317
> 在有公网 ip 的服务器上使用默认密码并暴露端口号有潜在的暴露 cookie 风险,因此**不推荐**在有公网 ip 的服务器映射端口号。
318318
> 如果需要在有公网 ip 的服务器上访问管理页面:
319-
> - 请务必在 `record.sh``--api-key`**重新设置密码**(最短 8 最长 80)!!!
319+
> - 请务必在 `record.sh``--api-key`**重新设置密码**(最短 8 最长 80)!
320320
> - 如需使用 https,可以考虑 openssl 自签名证书并添加参数 `--key-file path/to/key-file --cert-file path/to/cert-file`
321-
> - 最好再自行限制服务器端口入站 ip 规则或者采用 nginx 等反向代理配置限制他人访问。
322-
> - 管理页面主要针对 record 模块,record 模块启动后才能访问到可视化管理页面。
321+
> - 可以自行限制服务器端口入站 ip 规则或者采用 nginx 等反向代理配置限制他人访问。
322+
323+
Docker 版本的配置参考同上,登录方式更加简洁,启动后直接 `docker logs bilive_docker` 在日志中会打印登录二维码,扫码登录即可。
323324

324325
#### 无 GPU 版本
325326

326-
如果你能看到这行字,说明 0.3.0 版本还没有发布,会在两天内测试完发布,请耐心等待。可以尝试源码部署。注意:0.2.x 版本和 0.3.0 版本不兼容,如需采用 0.2.x 版本,请参考项目文档而不是本 README
327+
已构建 amd64 及 arm64 版本,会自动根据架构选择
327328

328329
```bash
329-
sudo docker run \
330-
-itd \
330+
docker run -itd \
331+
-v your/path/to/bilive.toml:/app/bilive.toml \
332+
-v your/path/to/settings.toml:/app/settings.toml \
333+
-v your/path/to/Videos:/app/Videos \
334+
-v your/path/to/logs:/app/logs \
331335
--name bilive_docker \
332336
-p 22333:2233 \
333337
ghcr.io/timerring/bilive:0.3.0

record.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ host=0.0.0.0
99
port=2233
1010

1111
kill -9 $(ps aux | grep '[b]lrec' | awk '{print $2}')
12-
nohup blrec -c $config --open --host $host --port $port --api-key bilive2233 > ./logs/runtime/blrec-$(date +%Y%m%d-%H%M%S).log 2>&1 &
12+
nohup blrec -c $config --open --host $host --port $port --api-key bilive2233 > ./logs/record/blrec-$(date +%Y%m%d-%H%M%S).log 2>&1 &
1313
if [ $? -eq 0 ]; then
1414
echo "success"
1515
else

settings.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ duration_limit = 1800
1919
out_dir = "./Videos" # Don't change this
2020

2121
[logging]
22-
log_dir = "./logs/blrec" # Don't change this
22+
log_dir = "./logs/record" # Don't change this
2323
console_log_level = "INFO"
2424
backup_count = 30
2525

start.sh

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
#!/bin/bash
2+
3+
LOGS_DIR="./logs"
4+
SUBDIRS=("record" "runtime" "scan" "upload")
5+
6+
for subdir in "${SUBDIRS[@]}"; do
7+
FULL_PATH="$LOGS_DIR/$subdir"
8+
if [ ! -d "$FULL_PATH" ]; then
9+
mkdir -p "$FULL_PATH"
10+
echo "Created directory: $FULL_PATH"
11+
else
12+
echo "Directory already exists: $FULL_PATH"
13+
fi
14+
done
15+
16+
# Run the record script
17+
./record.sh
18+
19+
# Start the scan process in the background
20+
nohup python -m src.burn.scan > ./logs/scan-$(date +%Y%m%d-%H%M%S).log 2>&1 &
21+
22+
# Start the upload process
23+
exec python -m src.upload.upload

0 commit comments

Comments
 (0)