# 需求 打开文档:http://127.0.0.1:5000/apidocs/ ## 项目结构规范 ``` algorithm-service/ ├── app/ │ ├── __init__.py # 可选 │ ├── main.py # 主应用 │ └── algorithms.py # 算法实现 ├── requirements.txt # Python依赖 ├── Dockerfile # Docker构建文件 └── README.md # 说明文档 ``` ## 镜像构建和运行 ``` # 构建镜像(注意最后的点表示当前目录) docker build -t algorithm-service . # 后台运行(添加-d参数) docker run -p 5121:5000 --name python-algo-service algorithm-service ```