Skip to content

Commit

Permalink
Merge branch 'pr77'
Browse files Browse the repository at this point in the history
  • Loading branch information
pjialin committed Jan 22, 2019
2 parents e8abbd5 + 91763f3 commit c71547e
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 2 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@ venv
__pycache__
env.py
env.slave.py
env.docker.py
env.docker.py
docker-compose.yml
15 changes: 14 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ python main.py


## Docker 使用
**1. 将配置文件下载到本地***
**1. 将配置文件下载到本地**
```bash
docker run --rm pjialin/py12306 cat /config/env.py > env.py
#
Expand All @@ -100,6 +100,19 @@ docker run --rm --name py12306 -p 8008:8008 -d -v $(pwd):/config -v py12306:/dat
```
当前目录会多一个 12306.log 的日志文件, `tail -f 12306.log`

### Docker-compose 中使用
**1. 复制配置文件**
```
cp docker-compose.yml.example docker-compose.yml
```

**2. 从 docker-compose 运行**

`docker-compose.yml`所在的目录使用命令
```
docker-compose up -d
```

## Web 管理页面

目前支持用户和任务以及实时日志查看,更多功能后续会不断加入
Expand Down
12 changes: 12 additions & 0 deletions docker-compose.yml.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
version: "2"
services:
py12306:
build: .
volumes:
- ./env.py:/config/env.py
- py12306:/data
ports:
- 8008:8008

volumes:
py12306:
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
-i http://mirrors.aliyun.com/pypi/simple/ --trusted-host mirrors.aliyun.com
appdirs==1.4.3
beautifulsoup4==4.7.0
bs4==0.0.1
Expand Down

0 comments on commit c71547e

Please sign in to comment.