docker-compose.yml 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. version: '2.4'
  2. services:
  3. postgres: # 数据库连接:jdbc:postgresql://{ip}:5432/{dbname} 用户名:postgres 密码:heliang
  4. image: postgres:12.10
  5. restart: always
  6. environment:
  7. POSTGRES_USER: postgres
  8. POSTGRES_PASSWORD: heliang
  9. POSTGRES_DB: postgres
  10. PGDATA: /var/lib/postgresql/data/pgdata
  11. LANG: C.UTF-8
  12. TZ: Asia/Shanghai
  13. volumes:
  14. - ./postgres/data/:/var/lib/postgresql/data/pgdata/:rw
  15. - ./postgres/init.d/:/docker-entrypoint-initdb.d/:rw
  16. - ./postgres/sql/:/sql/:rw
  17. - ./postgres/upgrade/:/upgrade/:rw
  18. networks:
  19. - mobe-network
  20. privileged: true
  21. xxl-job: #分布式任务调度 http://{ip}:8866/xxl-job-admin 后台登录用户名:admin 密码:123456
  22. image: heliang230/xxl-job-admin:2.3.0
  23. restart: always
  24. environment:
  25. APPLICATION_PORT: 8866 #调度中心web界面访问端口
  26. SERVER_SERVLET_CONTEXTPATH: /xxl-job-admin #web上下文
  27. POSTGRES_SERVICE_HOST: postgres #数据库
  28. POSTGRES_SERVICE_PORT: 5432 #数据库端口
  29. POSTGRES_SERVICE_DB_NAME: xxl_job #数据库名称
  30. POSTGRES_SERVICE_USER: postgres #数据库用户名
  31. POSTGRES_SERVICE_PASSWORD: heliang #数据库密码
  32. SERVICE_ACCESSTOKEN: d1bacd94024ed228 #调度中心与执行器服务认证凭证
  33. JAVA_OPTS: -Xmx512m
  34. volumes:
  35. - ./xxl-job/data/:/data/:rw
  36. ports:
  37. - 8866:8866
  38. networks:
  39. - mobe-network
  40. privileged: true
  41. depends_on:
  42. - postgres
  43. xxl-job-executor: #执行器
  44. image: heliang230/xxl-job-executor:2.3.2
  45. restart: always
  46. environment:
  47. SERVER_PORT: 8080 #执行器API端口
  48. SPRING_MAIN_WEB_ENVIRONMENT: "true" #是否开启web模式
  49. XXL_JOB_ADMIN_ADDRESSES: http://xxl-job:8866/xxl-job-admin #调度中心地址
  50. XXL_JOB_ACCESSTOKEN: d1bacd94024ed228 #执行器与调度中心token凭证
  51. XXL_JOB_EXECUTOR_APPNAME: xxl-job-executor #执行器应用名称
  52. XXL_JOB_EXECUTOR_ADDRESS: http://xxl-job-executor:9999/ #注册到调度中心的执行器地址信息
  53. XXL_JOB_EXECUTOR_IP: xxl-job-executor #执行器ip地址
  54. XXL_JOB_EXECUTOR_PORT: 9999 #执行器端口
  55. XXL_JOB_EXECUTOR_LOGPATH: /data/applogs/xxl-job/jobhandler #日志存储路径
  56. XXL_JOB_EXECUTOR_LOGRETENTIONDAYS: 30 #存储日志时间
  57. JAVA_OPTS: -Xmx512m
  58. SLEEP: 5 #启动容器后,休眠5秒中,为了防止报错
  59. volumes:
  60. - ./xxl-job-executor/data/:/data/:rw
  61. ports:
  62. - 8080:8080
  63. networks:
  64. - mobe-network
  65. privileged: true
  66. depends_on:
  67. - postgres
  68. - xxl-job
  69. networks:
  70. mobe-network: