compose.healthcheck.yaml 1.4 KB

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