docker-compose.yml 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. # 使用说明 V4.3.1
  2. # 1. PowerJob 根目录执行:docker-compose up
  3. # 2. 静静等待服务启动。
  4. version: '3'
  5. services:
  6. powerjob-mysql:
  7. environment:
  8. MYSQL_ROOT_HOST: "%"
  9. MYSQL_ROOT_PASSWORD: No1Bug2Please3!
  10. restart: always
  11. container_name: powerjob-mysql
  12. image: powerjob/powerjob-mysql:latest
  13. ports:
  14. - "3307:3306"
  15. volumes:
  16. - ./powerjob-data/powerjob-mysql:/var/lib/mysql
  17. command: --lower_case_table_names=1
  18. powerjob-server:
  19. container_name: powerjob-server
  20. image: powerjob/powerjob-server:latest
  21. restart: always
  22. depends_on:
  23. - powerjob-mysql
  24. environment:
  25. JVMOPTIONS: "-Xmx512m"
  26. PARAMS: "--oms.mongodb.enable=false --spring.datasource.core.jdbc-url=jdbc:mysql://powerjob-mysql:3306/powerjob-daily?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai"
  27. ports:
  28. - "7700:7700"
  29. - "10086:10086"
  30. - "10010:10010"
  31. volumes:
  32. - ./powerjob-data/powerjob-server:/root/powerjob/server/
  33. powerjob-worker-samples:
  34. container_name: powerjob-worker-samples
  35. image: powerjob/powerjob-worker-samples:latest
  36. restart: always
  37. depends_on:
  38. - powerjob-mysql
  39. - powerjob-server
  40. # environment:
  41. # PARAMS: "--powerjob.worker.server-address=powerjob-server:7700"
  42. ports:
  43. - "8081:8081"
  44. - "27777:27777"
  45. volumes:
  46. - ./powerjob-data/powerjob-worker-samples:/root/powerjob/worker
  47. - ./others/script/wait-for-it.sh:/wait-for-it.sh
  48. entrypoint:
  49. - "sh"
  50. - "-c"
  51. - "chmod +x wait-for-it.sh && ./wait-for-it.sh powerjob-server:7700 --strict -- java -Xmx512m -jar /powerjob-worker-samples.jar --powerjob.worker.server-address=powerjob-server:7700"