From 5f89db357d266ba4ec26f03da5b7ad0b141ab189 Mon Sep 17 00:00:00 2001 From: jhao Date: Wed, 11 Sep 2019 14:27:38 +0800 Subject: [PATCH] [update] docker --- Dockerfile | 17 +++++++++++++---- README.md | 9 +++++++++ cli/start.sh | 3 +++ 3 files changed, 25 insertions(+), 4 deletions(-) create mode 100755 cli/start.sh diff --git a/Dockerfile b/Dockerfile index abe8ddb07..d844c452f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,10 +1,19 @@ FROM python:3.6 -ENV DEBIAN_FRONTEND noninteractive + +MAINTAINER jhao104 + ENV TZ Asia/Shanghai + WORKDIR /usr/src/app + COPY ./requirements.txt . -RUN pip install --no-cache-dir -r requirements.txt + +RUN pip install --no-cache-dir -r requirements.txt -i https://pypi.tuna.tsinghua.edu.cn/simple/ + COPY . . + EXPOSE 5010 -WORKDIR /usr/src/app/ -CMD [ "python", "Run/main.py" ] + +WORKDIR /usr/src/app/cli + +ENTRYPOINT [ "sh", "start.sh" ] diff --git a/README.md b/README.md index 95974d0df..f9b1a5ec9 100644 --- a/README.md +++ b/README.md @@ -90,6 +90,15 @@ SERVER_API = { >>>python proxyPool.py webserver +``` + +### Docker + +```bash +docker pull jhao104/proxy_pool + +docker run --env db_type=REDIS --env db_host=127.0.0.1 --env db_port=6379 --env db_password=pwd_str -p 5010:5010 jhao104/proxy_pool + ``` diff --git a/cli/start.sh b/cli/start.sh new file mode 100755 index 000000000..15ba32bae --- /dev/null +++ b/cli/start.sh @@ -0,0 +1,3 @@ +#!/usr/bin/env bash +python proxyPool.py webserver & +python proxyPool.py schedule \ No newline at end of file