当前位置: 首页 > news >正文

powerjob连接postgresql数据库(支持docker部署)

1.先去pg建一个·powerjob-product·库

2.首先去拉最新的包,然后找到server模块,把mysql的配置文件信息替换成pg的

spring.datasource.hikari.auto-commit=true
spring.datasource.remote.hibernate.properties.hibernate.dialect=tech.powerjob.server.persistence.config.dialect.PowerJobPGDialect
spring.datasource.core.driver-class-name=org.postgresql.Driver
spring.datasource.core.jdbc-url=jdbc:postgresql://ip:15432/powerjob-product?currentSchema=public&serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf8&characterSetResults=utf8&useSSL=false&allowMultiQueries=true
currentSchema=public&serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf8&characterSetResults=utf8&useSSL=false&allowMultiQueries=true
spring.datasource.core.username=postgres
spring.datasource.core.password=postgres
spring.datasource.core.hikari.maximum-pool-size=20
spring.datasource.core.hikari.minimum-idle=5
spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.PostgreSQL94Dialect

3.搜索server中实体注解为@lob的实体,加一个注解

@org.hibernate.annotations.Type(type = "org.hibernate.type.TextType")

 然后启动就好了,这样可以jar包部署

下面是docker部署方法:

1.把项目中server下的docker下面的内容传到服务器上,加上server的jar包

传到指定目录下

2.运行Dockerfile打镜像命令

docker build -t tjqq/powerjob-server:v1 .

运行·docker images|grep powerjob·命令查看镜像是否打成功

成功后运行起docker容器命令

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:15432/powerjob-product?currentSchema=public&serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf8&characterSetResults=utf8&useSSL=false&allowMultiQueries=true --spring.datasource.core.username=postgres --spring.datasource.core.password=postgres --spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.PostgreSQL94Dialect --spring.datasource.core.auto-commit=true" \-v /data/cy/powerjob/powerjob-server:/root/powerjob/server -v /data/cy/powerjob/powerjob-server/.m2:/root/.m2 \tjqq/powerjob-server:v1

就可以成功启动了

注意:手动起的容器,没有前端页面,因此前端页面必须自己部署,用nginx代理一下

http://www.lryc.cn/news/415641.html

相关文章:

  • 浅谈位运算及其应用(c++)
  • Git版本管理中下列不适于Git的本地工作区域的是
  • webGL + WebGIS + 数据可视化
  • 职场“老油条”的常规操作,会让你少走许多弯路,尤其这三点
  • Ceres Cuda加速
  • 微信小程序生成小程序转发链接,携带参数跳转到另外一个页面
  • 图解RocketMQ之消息如何存储
  • 2024年中国信创产业发展白皮书精简版
  • Redis2-Redis常见命令
  • 一天攻克一个知识点 —— 设计模式之动态代理
  • 数据采集与预处理【大数据导论】
  • 白骑士的PyCharm教学进阶篇 2.2 高级调试技术
  • [网鼎杯]2018Unfinish
  • Java算法-力扣leetcode-383. 赎金信
  • 使用idea对spring全家桶的各种项目进行创建
  • FAT32、NTFS、FAT的区别
  • 捉虫笔记(二)之 杀软请你自重点
  • python学习之路 - python的函数
  • 使用SpringBoot+Vue3开发项目(2)---- 设计文章分类的相关接口及页面
  • Layui---toolbar与 tool的区别
  • U-Net++原理与实现(含Pytorch和TensorFlow源码)
  • 产品心理学:啦啦队效应
  • AC+AP组网
  • 2024.8.05(glibc的安装及MySQL的安全用户角色权限)
  • 【精选】6款一键生成论文的软件3000字论文网站
  • 如何使用 PHP Simple HTML DOM Parser 轻松获取网页中的特定数据
  • Linux笔记 --- 传统链表
  • C语言的编译(预处理操作)+链接
  • FFmpeg实战 - 解复用与解码
  • 8.5作业