飞腾ARM架构系统powerjob-server镜像构建,连接postgres数据库运行
·
背景
powerjob-server 的 docker 镜像没有 arm 架构版本
步骤
- 从 gitlab 拉取 powjob 项目源码
git clone https://github.com/PowerJob/PowerJob.git
cd PowerJob
- 搜索 server 代码中 @Lob 注解实体,加一个注解
@org.hibernate.annotations.Type(type = "org.hibernate.type.TextType")
- 使用 maven 构建
mvn clean package -Pdev -DskipTests
- 生成 jar 包
powerjob-server/powerjob-server-starter/target/powerjob-server.jar - 将 server 中的 Dockerfile 和 settings.xml 和 jar 包拷贝到 arm 服务器
- 在服务器拉取 openjdk 镜像

- docker build 构建
- 启动容器时指定数据库连接信息
docker run -d \
--restart=always \
--name powerjob-server \
-p 7700:7700 -p 10086:10086 -p 10010:10010 \
-e TZ="Asia/Shanghai" \
-e JVMOPTIONS="" \
-e PARAMS="--spring.profiles.active=product --spring.datasource.core.jdbc-url=jdbc:postgresql://IP:端口/powerjob-product(提前创建好的数据库)?currentSchema=public&serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf8&characterSetResults=utf8&useSSL=false&allowMultiQueries=true --spring.datasource.core.username=数据库用户名 --spring.datasource.core.password=数据库密码 --spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.PostgreSQL94Dialect --spring.datasource.core.auto-commit=true" \
powerjob-test:0902001(刚才构建的镜像)
更多推荐
所有评论(0)