Are you sure you want to delete this task? Once this task is deleted, it cannot be recovered.
huolongshe 97d0782ac8 | 1 year ago | |
---|---|---|
app | 1 year ago | |
.gitignore | 2 years ago | |
Dockerfile | 1 year ago | |
LICENSE | 2 years ago | |
README.md | 1 year ago | |
application.yml | 1 year ago | |
build-docker.sh | 2 years ago | |
pip-install-reqs.sh | 1 year ago | |
requirements.txt | 1 year ago | |
start.py | 2 years ago |
uapp2是基于 ServiceBoot微服务引擎 开发的 CubePy微服务框架 后端微服务样例程序,使用Python语言开发。
uapp2通过与papp1和uapp1配合来实现一个简易的博客应用。本例子的主要目的是为了展示如何在微服务中响应HTTP服务请求并进行相应的数据库增删改查等操作,因此它需要维护一个MySql数据库,用来实现博客内容的持久存储。注意在实际应用中,前端界面papp1其实可以直接访问uapp2,而不需要通过uapp1中转。
开发者可以参考该样例程序来开发自己的后端微服务应用(如何实现数据库增删改查等操作)。
监听端口
服务注册与发现:
统一数据配置中心: configserver
用户认证授权: uaa
数据库: MySql
开发环境中运行本微服务之前,需要先拉起项目依赖的后台docker。
$ cd ~/cubenet/cubepy/dev
$ docker-compose up
参见 CubePy微服务框架 之README文档。
分别运行前后端基础微服务:uaa、gateway、portal。
使用PyCharm打开本project所在目录。
建议在PyCharm中专门为本project新建一个专用Python虚拟环境,Python版本选择3.5以上。
在PyCharm的terminal窗口中执行如下命令安装依赖包:
$ sh pip-install-reqs.sh
依赖包安装完成后,可在terminal窗口中执行如下命令来查看serviceboot所有命令行格式:
$ serviceboot
在PyCharm窗口中右键单击“start.py”文件,选择“run 'start'”或者“debug 'start'”来运行或调试程序。
开发完成后,可在terminal窗口中执行如下命令来生成微服务docker镜像:
$ serviceboot build_docker
或者
$ sh build-docker.sh
CubePy微服务框架——后端微服务开发样例2
Python Dockerfile Shell Text
Dear OpenI User
Thank you for your continuous support to the Openl Qizhi Community AI Collaboration Platform. In order to protect your usage rights and ensure network security, we updated the Openl Qizhi Community AI Collaboration Platform Usage Agreement in January 2024. The updated agreement specifies that users are prohibited from using intranet penetration tools. After you click "Agree and continue", you can continue to use our services. Thank you for your cooperation and understanding.
For more agreement content, please refer to the《Openl Qizhi Community AI Collaboration Platform Usage Agreement》