ソースを参照

添加my文件夹,保存定制修改

incoding 7 年 前
コミット
e5c1b89c91
4 ファイル変更68 行追加0 行削除
  1. 37 0
      my/Config.ini
  2. 16 0
      my/Dockerfile
  3. 1 0
      my/build.sh
  4. 14 0
      my/run.sh

+ 37 - 0
my/Config.ini

@@ -0,0 +1,37 @@
+[DB]
+;Configure the database information
+;type: SSDB/MONGODB if use redis, only modify the host port,the type should be SSDB
+type = PROXY_POOL_DB_TYPE
+host = PROXY_POOL_DB_HOST
+port = PROXY_POOL_DB_PORT
+name = proxy
+;username = your_username (Only Mongodb)
+;password = your_password
+
+[ProxyGetter]
+;register the proxy getter function
+freeProxyFirst = 1
+freeProxySecond = 1
+;freeProxyThird  = 1
+freeProxyFourth = 1
+freeProxyFifth = 1
+;freeProxySixth = 1
+freeProxySeventh = 1
+;freeProxyEight = 1
+;freeProxyNinth = 1
+freeProxyTen = 1
+freeProxyEleven = 1
+freeProxyTwelve = 1
+;foreign website, outside the wall
+;freeProxyWallFirst = 1
+;freeProxyWallSecond = 1
+;freeProxyWallThird = 1
+
+[API]
+# API config http://127.0.0.1:5010
+# The ip specified when starting the web API
+ip = 0.0.0.0
+# he port on which to run the web API
+port = 8080
+# Flask processes option
+processes = 10

+ 16 - 0
my/Dockerfile

@@ -0,0 +1,16 @@
+FROM python:3.6
+
+WORKDIR /usr/src/app
+
+ENV TZ=Asia/Shanghai \
+	PROXY_POOL_DB_TYPE=SSDB \
+	PROXY_POOL_DB_HOST=redis \
+	PROXY_POOL_DB_PORT=6379
+
+COPY . .
+
+RUN pip install --no-cache-dir -r requirements.txt && cp my/Config.ini ./
+
+CMD [ "my/run.sh" ]
+
+EXPOSE 8080

+ 1 - 0
my/build.sh

@@ -0,0 +1 @@
+docker build -t registry.cn-beijing.aliyuncs.com/ryttech/proxy_pool:1.12.20181114 -f my/Dockerfile .

+ 14 - 0
my/run.sh

@@ -0,0 +1,14 @@
+#!/bin/bash
+
+for var in \
+	PROXY_POOL_DB_TYPE \
+	PROXY_POOL_DB_HOST \
+	PROXY_POOL_DB_PORT \
+; do
+	val="${!var}"
+	if [ "$val" ]; then
+		sed -ri "s/$var/$val/" Config.ini
+	fi
+done
+
+python Run/main.py