美文网首页
docker部署xxl-job-admin和xxl-job-ex

docker部署xxl-job-admin和xxl-job-ex

作者: zzz_0427 | 来源:发表于2024-06-02 11:16 被阅读0次
    目录结构

    sql脚本下载地址https://gitee.com/xuxueli0323/xxl-job/tree/master/doc/db

    初始化sql脚本

    jar目录存放xxl-job-executor执行器包,jar包到https://gitee.com/xuxueli0323/xxl-job/tree/master/xxl-job-executor-samples/xxl-job-executor-sample-springboot下载源码打包

    xxl-job-executor执行器dockerfille文件

    FROM openjdk:8
    MAINTAINER xuxueli
    
    ENV TZ=PRC
    RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
    
    ADD jar/xxl-job-executor-sample-springboot-*.jar /app.jar
    
    ENTRYPOINT ["sh","-c","java -jar $JAVA_OPTS /app.jar $PARAMS"]
    

    xxl-job docker-compose文件,因为xxl-job-admin镜像作者已经在docker.hub上传,所以不需要我们自己build

    version: '3'
    services:
      xxl-job-mysql:
        image: mysql:8.0.37
        container_name: xxl-job-mysql
        restart: always
        privileged: true
        ports:
          - 3306:3306
        environment:
          - TZ=Asia/Shanghai
          - MYSQL_ROOT_PASSWORD=root
        volumes:
          - ./db:/docker-entrypoint-initdb.d
          - /var/lib/mysql:/var/lib/mysql
        command:
          --lower_case_table_names=1
          --character-set-server=utf8mb4
          --collation-server=utf8mb4_general_ci
      xxl-job-admin:
        image: xuxueli/xxl-job-admin:2.3.0
        container_name: xxl-job-admin
        restart: always
        privileged: true
        ports:
          - 8080:8080
        environment:
          - PARAMS=--spring.datasource.url=jdbc:mysql://xxl-job-mysql:3306/xxl_job?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&serverTimezone=Asia/Shanghai  --spring.datasource.username=root  --spring.datasource.password=root
        depends_on:
          - xxl-job-mysql
      xxl-job-executor:
        build:
          context: ./
          dockerfile: ./Dockerfile-xxl-job-executor
        image: xxl-job-executor
        container_name: xxl-job-executor
        restart: always
        privileged: true
        ports:
          - 9999:9999
        environment:
          - PARAMS=--xxl.job.admin.addresses=http://xxl-job-admin:8080/xxl-job-admin --xxl.job.accessToken= --xxl.job.executor.ip=xxl-job-executor
        depends_on:
          - xxl-job-admin
    

    相关文章

      网友评论

          本文标题:docker部署xxl-job-admin和xxl-job-ex

          本文链接:https://www.haomeiwen.com/subject/neqsqjtx.html