liuyuqi-dellpc 6ac2ed264d 1 10 months ago
..
.circleci e9db99c0b9 Update 'python/.circleci/config.yml' 1 year ago
.devcontainer d8640ec7a8 add php and python remote-try from lyq/vscode-remote-try 1 year ago
.devcontainer2 b3e2cfe313 add python env 1 year ago
.github 579ebf2185 0 11 months ago
.ide edae51d903 add ide 1 year ago
.vscode d8640ec7a8 add php and python remote-try from lyq/vscode-remote-try 1 year ago
deploy 4ce486b3a5 0 1 year ago
frontend 649560a8cf add docker file 1 year ago
static d8640ec7a8 add php and python remote-try from lyq/vscode-remote-try 1 year ago
.coding-ci.yml 0523f46cc1 0 1 year ago
.gitattributes d8640ec7a8 add php and python remote-try from lyq/vscode-remote-try 1 year ago
.gitignore d8640ec7a8 add php and python remote-try from lyq/vscode-remote-try 1 year ago
.gitpod.Dockerfile ecd0cfde6c Add 'python/.gitpod.Dockerfile' 3 years ago
.gitpod.yml 0cca35f9e7 Add 'python/.gitpod.yml' 3 years ago
Dockerfile 6ac2ed264d 1 10 months ago
README.md bcccb6f9c4 1 1 year ago
Vagrantfile f24021cf18 add Vagrantfile 1 year ago
app.py d8640ec7a8 add php and python remote-try from lyq/vscode-remote-try 1 year ago
docker-compose.debug.yml 7512bd5b36 0 1 year ago
docker-compose.yml 42d765d72b Add 'python/docker-compose.yml' 1 year ago
main.py bcccb6f9c4 1 1 year ago
pipeline-build-flask.jenkinsfile a6ed1f7bc9 add Jenkinsfile 3 years ago
poetry.lock bcccb6f9c4 1 1 year ago
pyproject.toml bcccb6f9c4 1 1 year ago
requirements.txt d8640ec7a8 add php and python remote-try from lyq/vscode-remote-try 1 year ago

README.md

python

Deploy

部署的方法很多

前后端分别运行

开发模式下可以这样做

nginx + 前后分离

前端静态打包dist,nginx指定root目录即可,对于/api 请求,反向代理转发到 proxy_pass http://127.0.0.1:9999;

前端打包 dist,放到后端 dist 目录

前后端合并,适合打包成二进制交付部署

docker 部署

基于 nginx + 前后分离 模式,后端打包 jiamboy/fastapi 镜像,镜像中安装 nginx,多阶段构建镜像,把前端dist复制到后端镜像。启动命令:先启动nginx(后台自动运行),然后启动python app.py

docker-compose 部署

前端 + nginx 启动一个容器,后端 python.py 启动一个容器,数据库,redis等分别启动一个容器。