Skip to content
This repository has been archived by the owner on Jan 10, 2022. It is now read-only.

Commit

Permalink
增加docker-compose
Browse files Browse the repository at this point in the history
  • Loading branch information
catlair committed May 1, 2021
1 parent 5eb3e43 commit 4bc4e4f
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 4 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@

### docker 运行

- 开发测试中使用的 docker 环境, 由于技术有限, 用 docker 的大佬自己发挥吧。基本使用参考`.github/workflows/bilibili-task.yaml`
- 开发测试中使用的 docker 环境由于技术有限用 docker 的大佬自己发挥吧,最基本的使用详见`docker/docker-compose.yml`文件。

- 配置 `config/config.json` 并挂载到 `/usr/src/app/config`目录下

Expand Down Expand Up @@ -63,7 +63,7 @@
## 其他已知问题

- [ ] ~~关注的 up 列表是动态加载的, 目前存在只抓取到【全部关注】而非指定标签的情况(在延时和判断页面 loading 的情况下极小概率)~~
- [ ] #1
- [ ] [#1](https://github.com/catlair/bili-task-puppeteer/issues/1)

## 一些设想

Expand Down
13 changes: 13 additions & 0 deletions docker/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
version: '3.9'
services:
bili_task:
image: catlair/bilitaskpuppeteer:latest
container_name: catlair_bili_task
volumes:
- ../config/:/usr/src/app/config/
- ../logs/:/usr/src/app/logs/
tty: true
env_file: ../.env
user: root
cap_add:
- SYS_ADMIN
7 changes: 5 additions & 2 deletions tools/random_run.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#!/bin/bash
set -e

function random()
Expand All @@ -8,8 +9,10 @@ function random()
((retnum=num%max+min));
echo $retnum;
}
# 旧的不去新的不来
docker-compose -f docker/docker-compose.yml down
# 等待时间为执行开始后2 - 7200s中随机时间
out=$(random 2 7200)s;
sleep $out
# 已经运行的docker容器name为bili_jury
docker start bili_jury
# 执行
docker-compose -f docker/docker-compose.yml up -d

0 comments on commit 4bc4e4f

Please sign in to comment.