SprinBoot integrated Flowable enterprise-level workflow engine image production

Article Directory

One, the realization principle
1. Number of mirror images

Components: back-end process engine, front-end portal, mysql database

2. Calling process
Insert picture description here
3. Calling process analysis
1.首先把前台门户、后台、mysql单独制作成一个镜像
2.让前台门户镜像可以和mysql镜像之间通信
  让后台镜像可以和mysql镜像之间通信
  让前台门户、后台镜像、mysql镜像三者之间互相通信
3.实现docker容器之间通信的方案
  容器之间:添加链接--link参数

案例:
docker run -p 8080:8080 -p 9326:9326 --name eblog --link es_643:ees --link myrabbit:erabbit --link mymysql:emysql --link myredis:eredis -d eblog


解析: 
-p 8080:8080 -p 9326:9326 :9326是因为即时聊天需要用到的ws端口 
--link es_643:ees 表示关联容器,把容器es_643起别名为ees,
--link的作用就相当于在容器es_643的/etc/hosts中添加了一条容器名与ip的映射关系。以后eblog 容器就可以直接使用容器名与es_643进行通信了。

2. Preliminary preparation
2.1. Clone the project to local
Insert picture description here


Insert picture description here


Command clone project

git clone [email protected]:lwj/flow.git
2.2. Modify database connection and container alias

Adjust the database connection to the database address of the next container.
Replace the mysql database container alias with the ip address

Insert picture description here
Insert picture description here
2.3. Modify the request address to the container alias (backend)
Insert picture description here
3. Modify the request address to the container alias (front end)
3.1. Environment configuration
Insert picture description here


Insert picture description here
3.2. Installation dependencies
# 在NPM 中安装
npm install -g yarn

# 安装依赖
yarn install

If this exception occurs: 'yarn' is not an internal or external command, nor is it an executable program

3.3. Package Compilation
cd C:\Users\Administrator.DESKTOP-I5SJ4CK\Desktop\flow\flow-front-ui

# 执行编译打包
vite build && esno ./build/script/postBuild.ts
Fourth, prepare for mirroring
4.1. Project packaging
mvn clean package -Dmaven.test.skip=true
4.2. Package upload
Insert picture description here


Insert picture description here
4.3. Make Dockerfile

Backstage

vim Dockerfile

添加内容如下:
# Docker image for springboot file run
# VERSION 1.0.0
# Author: bruce.liu
FROM java:8
EXPOSE 8988
MAINTAINER bruce.liu <[email protected]>
ENV TZ=Asia/Shanghai
RUN ln -sf /usr/share/zoneinfo/{TZ} /etc/localtime && echo '{TZ}' > /etc/timezone
ADD flow-admin.jar /flow-admin.jar
RUN bash -c 'touch /flow-admin.jar'
ENTRYPOINT ["java","-Djava.security.egd=file:/dev/./urandom","-jar","/flow-admin.jar"]

Front portal

vim Dockerfile

添加内容如下:
# Docker image for springboot file run
# VERSION 1.0.0
# Author: bruce.liu
FROM java:8
EXPOSE 8990
MAINTAINER bruce.liu <[email protected]>
ENV TZ=Asia/Shanghai
RUN ln -sf /usr/share/zoneinfo/{TZ} /etc/localtime && echo '{TZ}' > /etc/timezone
ADD flow-front-rest.jar /flow-front-rest.jar
RUN bash -c 'touch /flow-front-rest.jar'
ENTRYPOINT ["java","-Djava.security.egd=file:/dev/./urandom","-jar","/flow-front-rest.jar"]
4.4. Make a background image
cd /app/admin/

docker  build -t flow-admin:1.0 .
Insert picture description here
4.5. Make front-end portal mirror
cd /app/portal/

docker  build -t flow-portal:1.0 .
Insert picture description here
4.6. Pull mysql mirror
# 拉取mysql5.7.27镜像
docker pull mysql:5.7.27
4.7. View image
docker images
Insert picture description here
Five, create a container and start
5.1. Create and run the mysql container
docker run --name mymysql -e MYSQL_ROOT_PASSWORD=123456 -d -p 3306:3306  mysql:5.7.27 
5.2. Create and run a background container
docker run -p 8988:8988 --name flow-admin --link flowmysql:flowmysql -d flow-admin:1.0

If you encounter this exception: the
flowable error message when the project starts version mismatch: library version is *, db version is *

5.3. Create and run the foreground portal container
docker run -p 8990:8990 --name flow-portal --link flowmysql:flowmysql --link flow-admin:flow-admin -d flow-portal:1.0
5.4. View the startup log
docker logs -f flow-admin
docker logs -f flow-portal
5.5. View the running container
docker ps
Insert picture description here
Six, service verification
6.1. Background service verification

http://192.168.60.128:8988/

Insert picture description here


Insert picture description here


Insert picture description here
6.2. Front-end portal service verification
Insert picture description here


Insert picture description here