-
Notifications
You must be signed in to change notification settings - Fork 692
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
24 additions
and
90 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,17 +20,27 @@ | |
|
||
- 创建初始账户: python manage.py createsuperuser | ||
- 启动开发环境: python manage.py runserver 如果需要启动在其他端口:python manage.py runserver 8888 | ||
- 安装node v14 | ||
- 安装前端依赖 | ||
进入到frontend目录下执行npm i | ||
- 启动前端开发环境 | ||
进入到frontend目录下执行npm run dev | ||
- 启动celery任务: celery -A tasks worker -l info -Q loonflow (用于执行任务脚本、触发任务hook、通知hook。本地开发二次开发如果不需要这些功能时可以不启动) | ||
|
||
|
||
------------- | ||
生产环境 | ||
生产环境源码部署 | ||
------------- | ||
- 生产环境建议使用nginx+uwsgi的方式部署(nginx及uwsgi配置文件可参考 https://github.com/blackholll/loonflow-helper/tree/master/deploy) | ||
- 生产环境建议使用nginx+uwsgi的方式部署 | ||
- 将settings/pro.py.sample在settings目录下复制一份并重命名为config.py | ||
- 创建数据库并修改settings/pro.py中相应配置(数据库配置、redis地址配置、日志路径配置等等) | ||
- 创建python虚拟环境: python3.6.x(python3.6最新稳定版) | ||
- 安装依赖包: pip install -r requirements/pro.txt | ||
- 编译前端 | ||
|
||
:: | ||
进入frontend目录下,依次执行npm i 和npm run build (主要需要事先安装好node,建议安装node v14版本) | ||
|
||
- 启动redis(用于生成唯一的工单流水号+celery异步任务[执行脚本、状态hook、通知hook],centos7下redis service配置文件可参考https://github.com/blackholll/loonflow-helper/tree/master/deploy) | ||
- 初始化数据库,导入初始化sql, 命令如下 | ||
|
||
|
@@ -53,7 +63,9 @@ | |
celery multi restart -A tasks worker -l info -c 8 -Q loonflow --logfile=xxx.log --pidfile=xxx.pid | ||
|
||
- 启动uwsgi | ||
uwsgi配置文件参考docker_compose_deploy/loonflow-web目录下uwsgi.ini | ||
- 启动nginx | ||
nginx配置文件参考docker_compose_deploy/loonflow-web目录下nginx.conf | ||
|
||
|
||
-------------------------------- | ||
|
@@ -82,7 +94,7 @@ | |
|
||
- 启动方式 | ||
|
||
确保已经安装了python3后。 cd 到 docker_compose_deploy/loonflow_only目录后,执行以下命令 | ||
确保已经安装了python3后。 cd 到 docker_compose_deploy目录后,执行以下命令 | ||
|
||
:: | ||
|
||
|
@@ -106,81 +118,3 @@ | |
python3 run.py stop | ||
|
||
|
||
------------------------------ | ||
演示环境docker compose方式运行 | ||
------------------------------ | ||
提供者: 逆寒刀([email protected]) | ||
|
||
|
||
安装前必读 | ||
>>>>>>>>> | ||
- 本方式会同时安装loonflow及shutongflow(looflow的调用方demo, https://github.com/youshutong2080/shutongFlow), shutongflow功能不够完善,所以仅供大家开发调用方程序时参考 | ||
- 强烈建议基于一台新装的CentOS 7安装。因为其它场景可能会触发一些未被测到的问题 | ||
- 这只是一个为了方便快速展示代码的demo,考虑到安全、性能等因素,请勿直接用于生产 | ||
- 至少需要2G内存,推荐4G | ||
|
||
安装前准备 | ||
>>>>>>>>> | ||
- 关闭firewalld | ||
|
||
:: | ||
|
||
# 关闭防火墙 | ||
systemctl stop firewalld.service | ||
# 检查防火墙状态 | ||
systemctl status firewalld | ||
|
||
- 关闭selinux | ||
|
||
建议永久关闭,而非临时关闭,详见 https://blog.csdn.net/zhoushengtao12/article/details/95346903 | ||
|
||
- 保证以下端口未被使用 | ||
|
||
:: | ||
|
||
3306 (mysql) | ||
6060 (loonflow) | ||
6061 (shutongFlow_frontend) | ||
6062 (shutongFlow_backend) | ||
6379 (redis) | ||
|
||
|
||
开始安装 | ||
>>>>>>>>> | ||
|
||
:: | ||
|
||
cd /opt && yum install -y git && git clone -b v1.0.3 https://gitee.com/shihowcom/loonflow_ro loonflow | ||
|
||
# 在如下文件完成必要配置,重点是ip | ||
vi loonflow/docker_compose_deploy/loonflow_shutongflow/config.json | ||
# 各参数含义如下 | ||
{ | ||
"ip": "117.33.233.74", # 你的centos7服务器的地址 | ||
"mysql": { | ||
"root_password": "mySql12#4,.De", # mysql的root密码 | ||
} | ||
} | ||
|
||
# 启动安装 | ||
cd loonflow && python ./docker_compose_deploy/loonflow_shutongflow/setup_all.py | ||
|
||
|
||
访问 | ||
>>>>>> | ||
docker容器们启动成功后,就可以通过以下方式访问了: | ||
|
||
- loonflow管理后台 | ||
|
||
:: | ||
|
||
访问地址: http://ip:6060/ ip为你的centos7服务器的ip地址 | ||
账号/密码: admin/loonflow123 | ||
|
||
- shutongflow | ||
|
||
:: | ||
|
||
访问地址: http://ip:6061/ ip为你的centos7服务器的ip地址 | ||
账号/密码: admin/yxuqtr | ||
|