fix: docker-compose failed randomly without healthcheck of elasticsearch. #14854 (#15034)

This commit is contained in:
Akash Jain 2024-02-05 18:28:00 +05:30 committed by GitHub
parent d852385966
commit 065a8e30da
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 29 additions and 8 deletions

View File

@ -57,6 +57,11 @@ services:
ports: ports:
- "9200:9200" - "9200:9200"
- "9300:9300" - "9300:9300"
healthcheck:
test: "curl -s http://localhost:9200/_cluster/health?pretty | grep status | grep -qE 'green|yellow' || exit 1"
interval: 15s
timeout: 10s
retries: 10
volumes: volumes:
- es-data:/usr/share/opensearch/data - es-data:/usr/share/opensearch/data
@ -248,7 +253,7 @@ services:
WEB_CONF_PERMISSION_POLICY_OPTION: ${WEB_CONF_PERMISSION_POLICY_OPTION:-""} WEB_CONF_PERMISSION_POLICY_OPTION: ${WEB_CONF_PERMISSION_POLICY_OPTION:-""}
depends_on: depends_on:
opensearch: opensearch:
condition: service_started condition: service_healthy
postgresql: postgresql:
condition: service_healthy condition: service_healthy
networks: networks:
@ -416,7 +421,7 @@ services:
- "5005:5005" - "5005:5005"
depends_on: depends_on:
opensearch: opensearch:
condition: service_started condition: service_healthy
postgresql: postgresql:
condition: service_healthy condition: service_healthy
execute-migrate-all: execute-migrate-all:

View File

@ -56,8 +56,14 @@ services:
ports: ports:
- "9200:9200" - "9200:9200"
- "9300:9300" - "9300:9300"
healthcheck:
test: "curl -s http://localhost:9200/_cluster/health?pretty | grep status | grep -qE 'green|yellow' || exit 1"
interval: 15s
timeout: 10s
retries: 10
volumes: volumes:
- es-data:/usr/share/elasticsearch/data - es-data:/usr/share/elasticsearch/data
execute-migrate-all: execute-migrate-all:
build: build:
@ -248,7 +254,7 @@ services:
WEB_CONF_PERMISSION_POLICY_OPTION: ${WEB_CONF_PERMISSION_POLICY_OPTION:-""} WEB_CONF_PERMISSION_POLICY_OPTION: ${WEB_CONF_PERMISSION_POLICY_OPTION:-""}
depends_on: depends_on:
elasticsearch: elasticsearch:
condition: service_started condition: service_healthy
mysql: mysql:
condition: service_healthy condition: service_healthy
networks: networks:
@ -417,7 +423,7 @@ services:
- "5005:5005" - "5005:5005"
depends_on: depends_on:
elasticsearch: elasticsearch:
condition: service_started condition: service_healthy
mysql: mysql:
condition: service_healthy condition: service_healthy
execute-migrate-all: execute-migrate-all:

View File

@ -51,6 +51,11 @@ services:
ports: ports:
- "9200:9200" - "9200:9200"
- "9300:9300" - "9300:9300"
healthcheck:
test: "curl -s http://localhost:9200/_cluster/health?pretty | grep status | grep -qE 'green|yellow' || exit 1"
interval: 15s
timeout: 10s
retries: 10
volumes: volumes:
- es-data:/usr/share/elasticsearch/data - es-data:/usr/share/elasticsearch/data
@ -236,7 +241,7 @@ services:
WEB_CONF_PERMISSION_POLICY_OPTION: ${WEB_CONF_PERMISSION_POLICY_OPTION:-""} WEB_CONF_PERMISSION_POLICY_OPTION: ${WEB_CONF_PERMISSION_POLICY_OPTION:-""}
depends_on: depends_on:
elasticsearch: elasticsearch:
condition: service_started condition: service_healthy
postgresql: postgresql:
condition: service_healthy condition: service_healthy
networks: networks:
@ -422,7 +427,7 @@ services:
- "8586:8586" - "8586:8586"
depends_on: depends_on:
elasticsearch: elasticsearch:
condition: service_started condition: service_healthy
postgresql: postgresql:
condition: service_healthy condition: service_healthy
execute-migrate-all: execute-migrate-all:

View File

@ -49,6 +49,11 @@ services:
ports: ports:
- "9200:9200" - "9200:9200"
- "9300:9300" - "9300:9300"
healthcheck:
test: "curl -s http://localhost:9200/_cluster/health?pretty | grep status | grep -qE 'green|yellow' || exit 1"
interval: 15s
timeout: 10s
retries: 10
volumes: volumes:
- es-data:/usr/share/elasticsearch/data - es-data:/usr/share/elasticsearch/data
@ -234,7 +239,7 @@ services:
WEB_CONF_PERMISSION_POLICY_OPTION: ${WEB_CONF_PERMISSION_POLICY_OPTION:-""} WEB_CONF_PERMISSION_POLICY_OPTION: ${WEB_CONF_PERMISSION_POLICY_OPTION:-""}
depends_on: depends_on:
elasticsearch: elasticsearch:
condition: service_started condition: service_healthy
mysql: mysql:
condition: service_healthy condition: service_healthy
networks: networks:
@ -420,7 +425,7 @@ services:
- "8586:8586" - "8586:8586"
depends_on: depends_on:
elasticsearch: elasticsearch:
condition: service_started condition: service_healthy
mysql: mysql:
condition: service_healthy condition: service_healthy
execute-migrate-all: execute-migrate-all: