activiti 6.0 部署

官网下载 activiti-6.0.0.zip,下载链接:
https://github.com/Activiti/Activiti/releases/download/activiti-6.0.0/activiti-6.0.0.zip
解压后,目录activiti-6.0.0/wars里包含三个war包:activiti-app.war,activiti-admin.war,activiti-rest.war

账号密码

activiti-app.war: 账号/密码:admin/test;  http://localhost:8080/activiti-app/
activiti-admin.war: 账号/密码:admin/admin;  http://localhost:8081/activiti-admin/
    admin配置Endpoint configuration: activiti-app.war应用信息
activiti-rest.war: 账号/密码:kermit/kermit;  http://localhost:8080/activiti-rest/docs/

修改数据库配置

activiti-app.war默认使用内存数据库h2,修改为mysql数据库
查找目标文件:jar -tvf activiti-app.war | grep activiti-app.properties
解压目标文件:jar -xvf activiti-app.war WEB-INF/classes/META-INF/activiti-app/activiti-app.properties
替换目标文件:jar -uvf activiti-app.war WEB-INF/classes/META-INF/activiti-app/activiti-app.properties

docker-compose部署
  1. docker-compose.yml
version: '3'
services:
  activiti-app:
    image: activiti-app:1.0
    ports:
      - "8080:8080"
    depends_on:
      - activiti-mysql
    networks:
      - activiti
  activiti-admin:
    image: activiti-admin:1.0
    ports:
      - "8081:8080"
    depends_on:
      - activiti-app
    networks:
      - activiti
  activiti-mysql:
    image: mysql:5.6
    ports:
      - "3306:3306"
    environment:
      MYSQL_ROOT_PASSWORD: 123456
    volumes:
      - $HOME/docker/activiti-mysql:/var/lib/mysql
      - $HOME/docker/activiti-mysql-init.sql:/docker-entrypoint-initdb.d/activiti-mysql-init.sql
    networks:
      - activiti
networks:
  activiti:
启动:docker-compose up -d
停止并删除:docker-compose down
  1. APP Dockerfile
FROM tomcat:9-jdk8
COPY activiti-app.war /usr/local/tomcat/webapps
在Dockerfile目录运行:docker build -t activiti-app:1.0 .
  1. ADMIN Dockerfile
FROM tomcat:9-jdk8
COPY activiti-admin.war /usr/local/tomcat/webapps
在Dockerfile目录运行:docker build -t activiti-admin:1.0 .
  1. activiti-mysql-init.sql
create database if not exists activiti default character set utf8 collate utf8_general_ci;
  1. activiti-app.properties(datasource.url配置)
datasource.url=jdbc:mysql://activiti-mysql:3306/activiti?characterEncoding=UTF-8

可以直接通过docker-compose.yml中定义的名称访问数据库

你可能感兴趣的:(activiti 6.0 部署)