docker-compose pour le déploiement en des images docker des microservices métiers et des services utilitaires

docker-compose.yml 4.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142
  1. version: '3.4'
  2. services:
  3. microservices-db:
  4. image: mysql:8.0
  5. container_name: microservices-db
  6. restart: always
  7. ports:
  8. - 3306:3306
  9. networks:
  10. - microservices-network
  11. environment:
  12. MYSQL_ROOT_PASSWORD: pwd
  13. #for not be lost after restarting containers all data are saved on volume:/var/lib/mysql
  14. volumes:
  15. - services-db:/var/lib/mysql
  16. healthcheck:
  17. test: ["CMD", "mysqladmin" ,"ping", "-h", "localhost", "-uroot", "-ppwd"]
  18. interval: 5s
  19. timeout: 5s
  20. retries: 20
  21. microservices-config-service:
  22. image: microservices-config-service:latest
  23. container_name: microservices-config-service
  24. ports:
  25. - 8280:8280
  26. networks:
  27. - microservices-network
  28. build:
  29. context: ../backend-frontend-app/spring-project-back/microservices-config-service
  30. dockerfile: Dockerfile
  31. healthcheck:
  32. test: ["CMD", "curl", "-I", "http://microservices-config-service:8280"]
  33. interval: 15s
  34. timeout: 10s
  35. retries: 3
  36. start_period: 40s
  37. microservices-registration-service:
  38. image: microservices-registration-service:latest
  39. container_name: microservices-registration-service
  40. build:
  41. context: ../backend-frontend-app/spring-project-back/microservices-registration-service
  42. dockerfile: Dockerfile
  43. ports:
  44. - 8761:8761
  45. networks:
  46. - microservices-network
  47. depends_on:
  48. microservices-config-service:
  49. condition: service_healthy
  50. healthcheck:
  51. test: ["CMD", "curl", "-I", "http://microservices-registration-service:8761"]
  52. interval: 30s
  53. timeout: 30s
  54. retries: 3
  55. start_period: 40s
  56. backend-frontend-gateway-service:
  57. image: backend-frontend-gateway-service:latest
  58. container_name: backend-frontend-gateway-service
  59. ports:
  60. - "8281:8281"
  61. build:
  62. context: ../backend-frontend-app/spring-project-back/backend-frontend-gateway-service
  63. dockerfile: Dockerfile
  64. depends_on:
  65. microservices-registration-service:
  66. condition: service_healthy
  67. networks:
  68. - microservices-network
  69. clean-archi-business-service-address:
  70. image: clean-archi-business-service-address:latest
  71. container_name: clean-archi-business-service-address
  72. build:
  73. context: ..//backend-frontend-app/spring-project-back/clean-archi-business-service-address
  74. dockerfile: Dockerfile
  75. ports:
  76. - 8282:8282
  77. depends_on:
  78. microservices-db:
  79. condition: service_healthy
  80. microservices-registration-service:
  81. condition: service_healthy
  82. networks:
  83. - microservices-network
  84. clean-archi-business-service-company:
  85. image: clean-archi-business-service-company:latest
  86. container_name: clean-archi-business-service-company
  87. build:
  88. context: ../backend-frontend-app/spring-project-back/clean-archi-business-service-company
  89. dockerfile: Dockerfile
  90. ports:
  91. - 8284:8284
  92. depends_on:
  93. microservices-db:
  94. condition: service_healthy
  95. microservices-registration-service:
  96. condition: service_healthy
  97. networks:
  98. - microservices-network
  99. clean-archi-business-service-employee:
  100. image: clean-archi-business-service-employee:latest
  101. container_name: clean-archi-business-service-employee
  102. build:
  103. context: ../backend-frontend-app/spring-project-back/clean-archi-business-service-employee
  104. dockerfile: Dockerfile
  105. ports:
  106. - 8283:8283
  107. depends_on:
  108. microservices-db:
  109. condition: service_healthy
  110. microservices-registration-service:
  111. condition: service_healthy
  112. networks:
  113. - microservices-network
  114. clean-archi-business-service-project:
  115. image: clean-archi-business-service-project:latest
  116. container_name: clean-archi-business-service-project
  117. build:
  118. context: ../backend-frontend-app/spring-project-back/clean-archi-business-service-project
  119. dockerfile: Dockerfile
  120. ports:
  121. - 8285:8285
  122. depends_on:
  123. microservices-db:
  124. condition: service_healthy
  125. microservices-registration-service:
  126. condition: service_healthy
  127. networks:
  128. - microservices-network
  129. networks:
  130. microservices-network:
  131. volumes:
  132. services-db:

Powered by TurnKey Linux.