5 Star 15 Fork 7

DataCloud / dockerize网站快速部署

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
MIT

Vue+FastAPI+mongodb Dockerize网站部署

简介

提供了一个快速部署模板,能够进行快速建站。使用了Nginx+Vue+FastAPI+mongodb。

前序准备

  1. 部署前安装Docker

  2. 将vue项目编译为静态文件

部署

# 克隆项目
git clone https://github.com/sovlookup/dockerize-website-vue-fastapi

# 进入项目目录
cd dockerize-website

# 进入静态文件目录
cd nginx/web/ # 将你编译后的网站前端放置于此

# 进入后端文件目录
cd api/app # 将你的网站后端放置于此

# 修改docker-compose.yml line20
VUE_APP_BASE_API=http://这里写你的域名/api/

# 回到根目录 启动
docker-compose -f docker-compose.yml up --build

网站搭建完毕 浏览器访问 http://localhost

其它

# URL规范
VUE_APP_BASE_API代理到后端的/

因此Vue项目中只需要指定baseurl为VUE_APP_BASE_API,API地址完全按照文档即可
(真实url = baseurl + 相对url)

# 例如
前端:在 '/test' post了 'aaa'
后端:在 '/test' 接收到 'aaa'

License

MIT

Copyright (c) 2020 于北

MIT License Copyright (c) 2020 于北 Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

简介

提供了一个快速部署模板,能够快速建立后台管理网站。使用了Nginx+Vue+FastAPI+mongodb。 展开 收起
Docker
MIT
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
Docker
1
https://gitee.com/DataDrop/dockerize-website-vue-fastapi.git
git@gitee.com:DataDrop/dockerize-website-vue-fastapi.git
DataDrop
dockerize-website-vue-fastapi
dockerize网站快速部署
master

搜索帮助