目录结构
初始化sql脚本
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
网友评论