No Description

lym 29aa482154 update cicd 3 months ago
test 29aa482154 update cicd 3 months ago
.drone.yml 445f0bd9dd update cicd 9 months ago
.gitignore 01c20a5c8c init 9 months ago
Dockerfile 598e485f7f update cicd 9 months ago
README.MD 01c20a5c8c init 9 months ago
dockerBuild.sh bff3f2b261 update cicd 9 months ago
handleManager.py 29aa482154 update cicd 3 months ago
index.html 29aa482154 update cicd 3 months ago
main.py fd9f15581f update cicd 9 months ago
requirements.txt 53e7e74f52 update cicd 9 months ago

README.MD

requirements.txt 自动生成

安装

 pip install pipreqs

执行

pipreqs . --encoding=utf8 --force

构建 Docker

# 1 将项目依赖库(即本地python环境)进行导出, 使用如下命令:
pipreqs . --encoding=utf8 --force

# 2. shell 时候下载,而非dockerfile构建时候下载,python项目所需依赖包到指定文件夹py_pkgs:
# pip download -d py_pkgs -r requirments.txt
# pip install --no-index --find-links=py_pkgs -r requirements.txt 

# 3. 在宿主机上, 新建文件夹, 以spider_py_client文件夹为例, 放入如下内容:
#	spider_py_client  (作为Python项目根目录)
#	|- modules (modules文件夹: 其中的内容是Python项目子目录文件)
#	|- run.py  (Python项目的执行入口)
#	|- requirements.txt  (步骤2生成的项目依赖列表)
#	|- Dockerfile.txt  (步骤4即将编写的文件)

# 4. 编写Dockerfile, 创建一个文件叫Dockerfile(已有)
# touch Dockerfile
 
# 5. 切换到代码路径下
cd /usr/lym/spider_py_client

# 6. 构建
docker build  --no-cache  -t="spider_py_client:latest" -t="spider_py_client:0.1" .

# 7. 查看
docker images
	spider_py_client  (作为Python项目根目录)
	|- modules (modules文件夹: 其中的内容是Python项目子目录文件)
	|- run.py  (Python项目的执行入口)
	|- requirements.txt  (步骤2生成的项目依赖列表)
	|- Dockerfile.txt  (步骤4即将编写的文件)