compose.healthcheck.yaml 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. version: "3"
  2. services:
  3. app:
  4. healthcheck:
  5. test: 'curl --fail 127.0.0.1:8000'
  6. depends_on:
  7. phpfpm:
  8. condition: service_started
  9. phpfpm:
  10. depends_on:
  11. db:
  12. condition: service_healthy
  13. redis:
  14. condition: service_healthy
  15. opensearch:
  16. condition: service_healthy
  17. rabbitmq:
  18. condition: service_healthy
  19. #elasticsearch:
  20. # condition: service_healthy
  21. db:
  22. healthcheck:
  23. test: 'mysqladmin ping -h localhost -u root -pmagento'
  24. interval: 5s
  25. timeout: 5s
  26. retries: 30
  27. redis:
  28. healthcheck:
  29. test: 'redis-cli ping || exit 1'
  30. interval: 5s
  31. timeout: 5s
  32. retries: 30
  33. opensearch:
  34. healthcheck:
  35. test: 'curl --fail opensearch:9200/_cat/health >/dev/null || exit 1'
  36. interval: 5s
  37. timeout: 5s
  38. retries: 30
  39. #elasticsearch:
  40. # healthcheck:
  41. # test: 'curl --fail elasticsearch:9200/_cat/health >/dev/null || exit 1'
  42. # interval: 5s
  43. # timeout: 5s
  44. # retries: 30
  45. rabbitmq:
  46. healthcheck:
  47. test: 'rabbitmq-diagnostics -q ping'
  48. interval: 5s
  49. timeout: 5s
  50. retries: 30
  51. mailcatcher:
  52. healthcheck:
  53. test: 'wget --no-verbose --tries=1 --spider 127.0.0.1:1080 || exit 1'