Docker PowerJob

1. Docker PowerJob

1. 拉取PowerJob服务端镜像
docker pull tjqq/powerjob-server:4.3.9

2. 创建数据卷目录用于持久化数据
mkdir -p /home/docker/powerjob/logs
mkdir -p /home/docker/powerjob/data
mkdir -p /home/docker/powerjob/server
mkdir -p /home/docker/powerjob/.m2

3. 创建数据库
CREATE DATABASE IF NOT EXISTS `powerjob` DEFAULT CHARSET utf8mb4;

4. 启动PowerJob服务
docker run -d --restart=always --name powerjob-server \
  -p 7700:7700 -p 10086:10086 -p 10010:10010 \
  -v /home/docker/powerjob/server:/root/powerjob/server -v /home/docker/powerjob/.m2:/root/.m2 \
  -e TZ="Asia/Shanghai" \
  -e JVMOPTIONS="-Xmx512m -Dpowerjob.network.external.address=10.226.97.219 -Dpowerjob.network.external.port.http=10010 -Dpowerjob.network.external.port.akka=10086" \
  -e PARAMS="--spring.profiles.active=product --spring.datasource.core.jdbc-url=jdbc:mysql://10.226.97.219:3306/powerjob?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai --spring.datasource.core.username=root --spring.datasource.core.password=Whxx@219" \
  tjqq/powerjob-server:4.3.9

# 方案(缺陷:无法连接)
docker run -d --restart=always --name powerjob-server \
  -p 7700:7700 -p 10086:10086 -p 10010:10010 \
  -v /home/docker/powerjob/server:/root/powerjob/server -v /home/docker/powerjob/.m2:/root/.m2 \
  -e TZ="Asia/Shanghai" \
  -e JVMOPTIONS="-XX:+UseG1GC -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/root/powerjob/logs/oom.hprof -Dpowerjob.network.interface.preferred=eth0" \
  -e PARAMS="--spring.profiles.active=product --spring.datasource.core.jdbc-url=jdbc:mysql://10.226.97.228:3306/powerjob?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai --spring.datasource.core.username=root --spring.datasource.core.password=Abc1234%" \
  tjqq/powerjob-server:4.3.9

# 加强版本
docker run -d --restart=always --name powerjob-server \
  -p 7700:7700 -p 10086:10086 -p 10010:10010 \
  -v /home/docker/powerjob/logs:/root/powerjob/logs \
  -v /home/docker/powerjob/data:/root/powerjob/data \
  -v /home/docker/powerjob/server:/root/powerjob/server -v /home/docker/powerjob/.m2:/root/.m2 \
  -e JVMOPTIONS="-XX:+UseG1GC -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/root/powerjob/logs/oom.hprof" \
  -e PARAMS="--spring.datasource.core.jdbc-url=jdbc:mysql://10.226.97.219:3306/powerjob?useUnicode=true&characterEncoding=UTF-8 --spring.datasource.core.username=root --spring.datasource.core.password=Whxx@219" \
  tjqq/powerjob-server:4.3.9




docker-compose

  ##powerjob.network.external.address可配置为外部宿主机地址,更详细见:https://www.yuque.com/powerjob/guidence/deploy_server
  powerjob-server:
    container_name: powerjob-server
    image: powerjob/powerjob-server:4.3.6
    restart: always
    environment:
      JVMOPTIONS: "-Xmx512m -Dpowerjob.network.external.address=172.30.0.70 -Dpowerjob.network.external.port.http=10010 -Dpowerjob.network.external.port.akka=10086"
      PARAMS: "--spring.datasource.core.jdbc-url=jdbc:mysql://mysql服务ip:端口/powerjob-product?useUnicode=true&characterEncoding=UTF-8&useSSL=false --spring.datasource.core.username=mysql账号名 --spring.datasource.core.password=mysql密码 --oms.mongodb.enable=false"
    ports:
      - 7700:7700
      - 10086:10086
      - 10010:10010
    networks:
      blade_net:
        ipv4_address: 172.30.0.70
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

与海boy

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值