增加dockererfile文件,支持在docker中运行

解决webapi.py运行时报错的bug
This commit is contained in:
zhupengfei
2020-05-26 13:55:51 +08:00
parent 1766dbf82c
commit 03f5dbf1b9
5 changed files with 72 additions and 10 deletions
+11
View File
@@ -0,0 +1,11 @@
#基于的基础镜像
FROM python:3.6
#代码添加到code文件夹,后面可以通过进入容器中看的
ADD ./ /code
# 设置code文件夹是工作目录
WORKDIR /code
# 安装支持
RUN pip install -r requirement.txt -i https://pypi.tuna.tsinghua.edu.cn/simple
#当容器启动时,使用python3执行指定路径的py脚本
CMD ["python", "/code/WebAPI.py"]