# recom **Repository Path**: hetangfish/recom ## Basic Information - **Project Name**: recom - **Description**: recomrecomrecom - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2022-08-03 - **Last Updated**: 2022-08-09 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README #### 文件结构说明 - Dockerfile 默认使用`Python3.8`作为基础镜像. - app/app/main.py 项目的示例入口模块. - gunicorn_conf.py `gunicorn`的配置文件, 设置有默认值. - start.sh 容器默认的启动命令, 用于生产环境. - start-reload.sh 用于在开发环境下启动容器, 只会运行`uvicorn`, 不会启动`gunicorn`, 此时`gunicorn_conf.py`文件不起作用. - app/app/core 项目的算法代码文件夹,由main.py调用的核心算法接口模块 - app/prestart.sh web服务启动前执行的脚本,如:连接数据库、配置环境变量等命令,web服务器启动前自动调用该脚本 - requirements.txt 脚本运行时需要的python环境,每行一个,建议标明版本号,例如“fastapi==2.11.8” - nginx.conf 内置nginx反向代理配置,默认服务器启动3个实例,由nginx自动负载均衡,提升服务器响应速度。 #### 安装 1. 本机环境安装docker,并确保docker-compose命令可用 2. 切换到项目文件夹下,运行命令:docker-compose up --scale webapp=3 -d,等待一段时间后自动启动成功 3. 服务器默认端口8012 4. 停止服务器命令:docker-compose down #### 说明 1. 测试环境下,请将dockerfile文件最后一行CMD ["/start.sh"]改为“CMD ["/start-reload.sh"]” 2. 打开调试选项:docker-compose.yml文件中在“environment“下添加“- LOG_LEVEL=debug”选项 3. 生产环境部署,只需上述两处还原即可。 4. 系统运行日志自动写入到项目根目录下的local_logs文件夹下 #### 集成 1.将算法模块.py文件拷贝到core文件夹下 2.在main.py文件中添加get/post方法接口及相应的路径映射 3.停止服务器更新文件后,重新启动服务器 4.浏览器输入对应的命令测试是否成功 #### Gitee Feature 1. You can use Readme\_XXX.md to support different languages, such as Readme\_en.md, Readme\_zh.md 2. Gitee blog [blog.gitee.com](https://blog.gitee.com) 3. Explore open source project [https://gitee.com/explore](https://gitee.com/explore) 4. The most valuable open source project [GVP](https://gitee.com/gvp) 5. The manual of Gitee [https://gitee.com/help](https://gitee.com/help) 6. The most popular members [https://gitee.com/gitee-stars/](https://gitee.com/gitee-stars/)