docker-compose.yml 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. # 构建 PowerJob 测试环境
  2. version: '3.7'
  3. services:
  4. powerjob-mysql:
  5. build:
  6. context: ../
  7. environment:
  8. MYSQL_ROOT_HOST: "%"
  9. MYSQL_ROOT_PASSWORD: No1Bug2Please3!
  10. deploy:
  11. resources:
  12. limits:
  13. memory: 768M
  14. restart: always
  15. container_name: powerjob-mysql
  16. image: powerjob/powerjob-mysql:test_env
  17. ports:
  18. - "3309:3306"
  19. volumes:
  20. - ~/powerjob-data/powerjob-mysql:/var/lib/mysql
  21. command: --lower_case_table_names=1
  22. # powerjob-mongodb:
  23. # image: mongo:latest
  24. # container_name: powerjob-mongodb
  25. # restart: always
  26. # deploy:
  27. # resources:
  28. # limits:
  29. # memory: 256M
  30. # environment:
  31. # MONGO_INITDB_ROOT_USERNAME: "root"
  32. # MONGO_INITDB_ROOT_PASSWORD: "No1Bug2Please3!"
  33. # MONGO_INITDB_DATABASE: "powerjob_daily"
  34. # ports:
  35. # - "27017:27017"
  36. # volumes:
  37. # - ./testenv/init_mongodb.js:/docker-entrypoint-initdb.d/mongo-init.js:ro
  38. # - ~/powerjob-data/powerjob-mongodb:/data/db
  39. powerjob-server:
  40. build:
  41. context: ../../powerjob-server/docker
  42. deploy:
  43. resources:
  44. limits:
  45. memory: 896M
  46. container_name: powerjob-server
  47. image: powerjob/powerjob-server:test_env
  48. restart: always
  49. depends_on:
  50. - powerjob-mysql
  51. # - powerjob-mongodb
  52. environment:
  53. PARAMS: "--spring.profiles.active=daily --spring.datasource.core.jdbc-url=jdbc:mysql://powerjob-mysql:3306/powerjob-daily?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai --oms.storage.dfs.mysql_series.url=jdbc:mysql://powerjob-mysql:3306/powerjob-daily?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai"
  54. JVMOPTIONS: "-server -XX:+UseG1GC -XX:+PrintGCDetails -XX:+PrintGCDateStamps -XX:+UseGCLogFileRotation -XX:NumberOfGCLogFiles=7 -XX:GCLogFileSize=100M -Xloggc:/root/powerjob/server/gc.log"
  55. ports:
  56. - "7700:7700"
  57. - "10086:10086"
  58. - "10010:10010"
  59. volumes:
  60. - ~/powerjob-data/powerjob-server:/root/powerjob/server/
  61. - ~/.m2:/root/.m2
  62. powerjob-worker-agent:
  63. build:
  64. context: ../../powerjob-worker-agent
  65. deploy:
  66. resources:
  67. limits:
  68. memory: 384M
  69. container_name: powerjob-worker-agent
  70. image: powerjob/powerjob-worker-agent:test_env
  71. restart: always
  72. depends_on:
  73. - powerjob-mysql
  74. - powerjob-server
  75. ports:
  76. - "5002:5005"
  77. - "10002:10000"
  78. - "27777:27777"
  79. volumes:
  80. - ~/powerjob-data/powerjob-worker-agent:/root
  81. entrypoint:
  82. - "sh"
  83. - "-c"
  84. - "./wait-for-it.sh powerjob-server:7700 --strict -- java -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5005 -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=10000 -Dcom.sun.management.jmxremote.rmi.port=10000 -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false -server -XX:+UseG1GC -XX:+PrintGCDetails -XX:+PrintGCDateStamps -XX:+UseGCLogFileRotation -XX:NumberOfGCLogFiles=7 -XX:GCLogFileSize=100M -Xloggc:/root/gc.log -jar /powerjob-agent.jar --app powerjob-worker-samples --server powerjob-server:7700"
  85. powerjob-worker-agent2:
  86. deploy:
  87. resources:
  88. limits:
  89. memory: 384M
  90. container_name: powerjob-worker-agent2
  91. image: powerjob/powerjob-worker-agent:test_env
  92. restart: always
  93. depends_on:
  94. - powerjob-mysql
  95. - powerjob-server
  96. ports:
  97. - "5003:5005"
  98. - "10003:10000"
  99. - "27778:27777"
  100. volumes:
  101. - ~/powerjob-data/powerjob-worker-agent2:/root
  102. entrypoint:
  103. - "sh"
  104. - "-c"
  105. - "./wait-for-it.sh powerjob-server:7700 --strict -- java -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5005 -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=10000 -Dcom.sun.management.jmxremote.rmi.port=10000 -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false -server -XX:+UseG1GC -XX:+PrintGCDetails -XX:+PrintGCDateStamps -XX:+UseGCLogFileRotation -XX:NumberOfGCLogFiles=7 -XX:GCLogFileSize=100M -Xloggc:/root/gc.log -jar /powerjob-agent.jar --app powerjob-worker-samples --server powerjob-server:7700"