compose.healthcheck.yaml 1.2 KB

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