Skip to content

Commit

Permalink
Use healthcheck to make sure elasticsearch has (#1212)
Browse files Browse the repository at this point in the history
started before starting backend.

Backend used to fail with docker compose prod.
  • Loading branch information
lmarini authored Nov 15, 2024
1 parent f01c46a commit dba247a
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 31 deletions.
10 changes: 0 additions & 10 deletions docker-compose.extractors.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
version: '3.7'


services:
name-entity-recognition:
image: socialmediamacroscope/name_entity_recognition_extractor:latest
Expand Down Expand Up @@ -47,15 +46,6 @@ services:
- clowder2
restart: unless-stopped

wordcount:
image: clowder/extractors-wordcount:latest
environment:
CLOWDER_VERSION: 2
RABBITMQ_URI: amqp://guest:guest@rabbitmq:5672/%2F
networks:
- clowder2
restart: unless-stopped

image-preview:
image: clowder/extractors-image-preview:latest
environment:
Expand Down
16 changes: 0 additions & 16 deletions docker-compose.previewers.yml
Original file line number Diff line number Diff line change
@@ -1,21 +1,5 @@
version: '3.7'

# Settings and configurations that are common for all containers
x-minio-common: &minio-common
image: quay.io/minio/minio:RELEASE.2022-01-25T19-56-04Z
command: server --console-address ":9001" http://minio{1...4}/data
expose:
- "9000"
- "9001"
environment:
MINIO_ROOT_USER: minioadmin
MINIO_ROOT_PASSWORD: minioadmin
healthcheck:
test: [ "CMD", "curl", "-f", "http://localhost:9000/minio/health/live" ]
interval: 30s
timeout: 20s
retries: 3

services:

geoserver:
Expand Down
17 changes: 12 additions & 5 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,16 @@ services:
keycloak_base: http://localhost/api
frontend_url: http://localhost
depends_on:
- mongo
- minio-nginx
- keycloak
- elasticsearch
- rabbitmq
mongo:
condition: service_started
minio-nginx:
condition: service_started
keycloak:
condition: service_started
elasticsearch:
condition: service_healthy
rabbitmq:
condition: service_started
labels:
- "traefik.enable=true"
- "traefik.http.routers.backend.rule=PathPrefix(`/api`)"
Expand Down Expand Up @@ -245,6 +250,8 @@ services:
elasticsearch:
image: docker.elastic.co/elasticsearch/elasticsearch:8.3.3
restart: unless-stopped
healthcheck:
test: "curl -f http://localhost:9200/_cluster/health?wait_for_status=yellow"
networks:
- clowder2
environment:
Expand Down

0 comments on commit dba247a

Please sign in to comment.