本文主要是介绍工单系统ferry 01--docker部署ferry,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
工单系统ferry 01--docker部署ferry
- 介绍
- 部署
- 说明
介绍
开源软件ferry是集工单统计、任务钩子、权限管理、灵活配置流程与模版等等于一身的开源工单系统,当然也可以称之为工作流引擎。
致力于减少跨部门之间的沟通,自动任务的执行,提升工作效率与工作质量,减少不必要的工作量与人为出错率。
本文主要介绍如何在linux 系统上通过docker 的方式部署 ferry,以便于体验ferry 系统。
部署
部署mysql
安装 mysql:
$ docker run -d -p3306:3306 --name=mysql5 -e MYSQL_ROOT_PASSWORD=111111 mysql:5
进入mysql实例
$ docker exec -it mysql5 bash
创建数据库 ferry
root@1d0043eefed4:/# mysql -uroot -h127.0.0.1 -p111111
mysql> create database ferry;
Query OK, 1 row affected (0.00 sec)
部署redis
安装 redis:
docker run --name=redis6.0 -d -p 6379:6379 redis:6.0
启动ferry
通过 ip r 或者 ifconfig 获取本机ip地址, 192.168.1.7
clone 代码
$ git clone https://github.com/lanyulei/ferry.git
$ cd ferry$ vim config/setings.yml
做如下修改:
mysql 配置(更改host 和密码为你自己的):
host: ferry_mysql -> host: 192.168.1.7
password: 123456 -> password: 111111redis 配置(更改host为你自己的):
url: redis://ferry_redis:6379 -> url: redis://192.168.1.7:6379在config 目录新建 needinit 文件, 第一次启动的时候db中没有数据,此时可以通过这命令初始化数据,服务正常启动后再删该文件(以防下次容器启动时候再次初始化)
$ touch config/needinit启动容器:
docker run -itd --name ferry -v /home/your_user_path/github/ferry/config:/opt/workflow/ferry/config -p 8002:8002 lanyulei/ferry:1.0.1
docker run -itd --name ferry -v /home/xg/soft/ferry/config:/opt/workflow/ferry/config -p 8002:8002 lanyulei/ferry:1.0.1输出如下:
start init
{"level":"info","ts":"2022-03-24 09:43:48.315052","caller":"database/mysql.go:37","msg":"mysql connect success!"}
{"level":"info","ts":"2022-03-24 09:44:03.338257","caller":"migrate/server.go:41","msg":"数据库结构初始化成功!"}
-- 开始初始化数据 -- 数据完成
数据库基础数据初始化成功
2022/03/24 09:44:26 starting api server
{"level":"info","ts":"2022-03-24 09:44:26.348398","caller":"database/mysql.go:37","msg":"mysql connect success!"}
INFO: 2022/03/24 09:44:26 worker.go:57 Launching a worker with the following settings:
INFO: 2022/03/24 09:44:26 worker.go:58 - Broker: redis://10.194.16.181:6379
INFO: 2022/03/24 09:44:26 worker.go:60 - DefaultQueue: ServerTasksQueue
INFO: 2022/03/24 09:44:26 worker.go:64 - ResultBackend: ://
[GIN-debug] [WARNING] Running in "debug" mode. Switch to "release" mode in production.- using env: export GIN_MODE=release- using code: gin.SetMode(gin.ReleaseMode)[GIN-debug] GET /info --> ferry/handler.Ping (7 handlers)
[GIN-debug] GET /static/*filepath --> github.com/gin-gonic/gin.(*RouterGroup).createStaticHandler.func1 (7 handlers)
[GIN-debug] HEAD /static/*filepath --> github.com/gin-gonic/gin.(*RouterGroup).createStaticHandler.func1 (7 handlers)
INFO: 2022/03/24 09:44:26 redis.go:96 [*] Waiting for messages. To exit press CTRL+C
[GIN-debug] Loaded HTML Templates (2): - - index.html[GIN-debug] GET /swagger/*any --> github.com/swaggo/gin-swagger.CustomWrapHandler.func1 (7 handlers)
[GIN-debug] GET /api/v1/monitor/server --> ferry/apis/monitor.ServerInfo (7 handlers)
.......
[GIN-debug] PUT /api/v1/work-order/active-order/:id --> ferry/apis/process.ActiveOrder (9 handlers)
[GIN-debug] DELETE /api/v1/work-order/delete/:id --> ferry/apis/process.DeleteWorkOrder (9 handlers)
[GIN-debug] POST /api/v1/work-order/reopen/:id --> ferry/apis/process.ReopenWorkOrder (9 handlers)
2022/03/24 09:44:26 Server Run http://0.0.0.0:8002/
2022/03/24 09:44:26 Swagger URL http://0.0.0.0:8002/swagger/index.html
2022/03/24 09:44:26 Enter Control + C Shutdown Server db 初始化后会自动新建如下 table
'casbin_rule'
'p_process_classify'
'p_process_info'
'p_task_history'
'p_task_info'
'p_tpl_info'
'p_work_order_circulation_history'
'p_work_order_info'
'p_work_order_tpl_data'
'sys_dept'
'sys_loginlog'
'sys_menu'
'sys_post'
'sys_role'
'sys_role_dept'
'sys_role_menu'
'sys_settings'
'sys_user'
测试
Url http://127.0.0.1:8002/
帐号密码 admin/123456
启动后 ferry mysql redis 都需要正常运行,如下所示:
xg@xg:~/soft/ferry$ docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
8611f6e09505 lanyulei/ferry:1.0.1 "/opt/workflow/ferry…" 12 minutes ago Up 12 minutes 0.0.0.0:8002->8002/tcp, :::8002->8002/tcp ferry
f320fd3bec25 redis:6.0 "docker-entrypoint.s…" 17 minutes ago Up 17 minutes 0.0.0.0:6379->6379/tcp, :::6379->6379/tcp redis6.0
480ebae668d9 mysql:5 "docker-entrypoint.s…" 18 minutes ago Up 18 minutes 0.0.0.0:3306->3306/tcp, :::3306->3306/tcp, 33060/tcp mysql5
登陆界面:
工单主页:
说明
软件环境:
20.04.1 LTS Desktop
Docker 20.10.7
参考文档:
ferry官方文档
ferry文档教程–手动部署
ferry文档教程–Docker部署
这篇关于工单系统ferry 01--docker部署ferry的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!