From 1e35f6e3a0cd5a40c39833139d1fd76f4f92eaeb Mon Sep 17 00:00:00 2001 From: Jalin Date: Tue, 9 Jul 2019 19:57:12 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20docker=20=E4=BD=BF?= =?UTF-8?q?=E7=94=A8=E8=AF=B4=E6=98=8E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 18 ++++++++++++++++++ config.toml.example | 2 +- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index adc1c47..c6dde22 100644 --- a/README.md +++ b/README.md @@ -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, 如 @@ -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 文件 diff --git a/config.toml.example b/config.toml.example index d0a61e0..8a33a58 100644 --- a/config.toml.example +++ b/config.toml.example @@ -2,7 +2,7 @@ env = "production" [web] -host = "127.0.0.1" +host = "0.0.0.0" port = 8080 [redis]