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

docker-compose.yml 4.1KB

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

Powered by TurnKey Linux.