Skip to content

Commit

Permalink
更新 docker 使用说明
Browse files Browse the repository at this point in the history
  • Loading branch information
pjialin committed Jul 9, 2019
1 parent 9289738 commit 1e35f6e
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
18 changes: 18 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,31 @@ cd pyproxy-async
```
pip install -r requirements.txt
```

3. 完善配置文件
```
cp config.toml.example config.toml
```

4. 启动
```
python main.py
```
### Docker 使用
1. 拉取镜像
```
docker pull pjialin/pyproxy-async:latest
```

2. 下载配置文件
```
curl -o config.toml https://raw.githubusercontent.com/pjialin/pyproxy-async/master/config.toml.example
```

3. 启动
```
docker run -d -v $(PWD)/config.toml:/code/config.toml -v pyproxy-data:/code/data --name pyproxy pjialin/pyproxy-async:latest
```

## Web Api
启动完成之后,访问 `127.0.0.1:8080/get_ip` (配置文件中的端口),即可获得一个随机的 IP, 如
Expand All @@ -49,6 +66,7 @@ curl http://127.0.0.1:8080/get_ip?https=1
127.0.0.1:80
127.0.0.1:8080
```

2. 加载到 IP 池中
```
python load.py [file_name] # 默认加载所有 *.ip.txt 文件
Expand Down
2 changes: 1 addition & 1 deletion config.toml.example
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
env = "production"

[web]
host = "127.0.0.1"
host = "0.0.0.0"
port = 8080

[redis]
Expand Down

0 comments on commit 1e35f6e

Please sign in to comment.