Skip to content

Commit dba247a

Browse files
authored
Use healthcheck to make sure elasticsearch has (#1212)
started before starting backend. Backend used to fail with docker compose prod.
1 parent f01c46a commit dba247a

File tree

3 files changed

+12
-31
lines changed

3 files changed

+12
-31
lines changed

docker-compose.extractors.yml

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
version: '3.7'
22

3-
43
services:
54
name-entity-recognition:
65
image: socialmediamacroscope/name_entity_recognition_extractor:latest
@@ -47,15 +46,6 @@ services:
4746
- clowder2
4847
restart: unless-stopped
4948

50-
wordcount:
51-
image: clowder/extractors-wordcount:latest
52-
environment:
53-
CLOWDER_VERSION: 2
54-
RABBITMQ_URI: amqp://guest:guest@rabbitmq:5672/%2F
55-
networks:
56-
- clowder2
57-
restart: unless-stopped
58-
5949
image-preview:
6050
image: clowder/extractors-image-preview:latest
6151
environment:

docker-compose.previewers.yml

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,5 @@
11
version: '3.7'
22

3-
# Settings and configurations that are common for all containers
4-
x-minio-common: &minio-common
5-
image: quay.io/minio/minio:RELEASE.2022-01-25T19-56-04Z
6-
command: server --console-address ":9001" http://minio{1...4}/data
7-
expose:
8-
- "9000"
9-
- "9001"
10-
environment:
11-
MINIO_ROOT_USER: minioadmin
12-
MINIO_ROOT_PASSWORD: minioadmin
13-
healthcheck:
14-
test: [ "CMD", "curl", "-f", "http://localhost:9000/minio/health/live" ]
15-
interval: 30s
16-
timeout: 20s
17-
retries: 3
18-
193
services:
204

215
geoserver:

docker-compose.yml

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -64,11 +64,16 @@ services:
6464
keycloak_base: http://localhost/api
6565
frontend_url: http://localhost
6666
depends_on:
67-
- mongo
68-
- minio-nginx
69-
- keycloak
70-
- elasticsearch
71-
- rabbitmq
67+
mongo:
68+
condition: service_started
69+
minio-nginx:
70+
condition: service_started
71+
keycloak:
72+
condition: service_started
73+
elasticsearch:
74+
condition: service_healthy
75+
rabbitmq:
76+
condition: service_started
7277
labels:
7378
- "traefik.enable=true"
7479
- "traefik.http.routers.backend.rule=PathPrefix(`/api`)"
@@ -245,6 +250,8 @@ services:
245250
elasticsearch:
246251
image: docker.elastic.co/elasticsearch/elasticsearch:8.3.3
247252
restart: unless-stopped
253+
healthcheck:
254+
test: "curl -f http://localhost:9200/_cluster/health?wait_for_status=yellow"
248255
networks:
249256
- clowder2
250257
environment:

0 commit comments

Comments
 (0)