Use wait-for-it in order to only start Jaeger after Elasticsearch is ready.

This commit is contained in:
Ivaylo Novakov 2021-05-11 13:51:58 +02:00
parent 020eab2e12
commit 05b4b5a527
No known key found for this signature in database
GPG Key ID: 06B9354AB08BE9C6
5 changed files with 21 additions and 5 deletions

3
.gitmodules vendored Normal file
View File

@ -0,0 +1,3 @@
[submodule "docker/wait-for-it/wait-for-it"]
path = docker/wait-for-it/wait-for-it
url = https://github.com/vishnubob/wait-for-it.git

View File

@ -70,7 +70,7 @@ services:
kratos-migrate:
image: oryd/kratos:v0.5.5-alpha.1
container_name: kratos-migrate
restart: "no"
restart: off
logging: *default-logging
environment:
- DSN=cockroach://root@cockroach:26257/defaultdb?max_conns=20&max_idle_conns=4&sslmode=verify-full&sslcert=/certs/node.crt&sslkey=/certs/node.key&sslrootcert=/certs/ca.crt

View File

@ -13,8 +13,6 @@ services:
- JAEGER_AGENT_HOST=jaeger-agent
- JAEGER_AGENT_PORT=6831
- JAEGER_REPORTER_LOG_SPANS=false
depends_on:
- jaeger-agent
jaeger-agent:
image: jaegertracing/jaeger-agent
@ -49,7 +47,7 @@ services:
shared:
ipv4_address: 10.10.10.91
depends_on:
- elasticsearch
- wait-for-it
jaeger-query:
image: jaegertracing/jaeger-query
@ -67,7 +65,18 @@ services:
shared:
ipv4_address: 10.10.10.92
depends_on:
- elasticsearch
- wait-for-it
wait-for-it:
build:
context: ./docker/wait-for-it
dockerfile: Dockerfile
command: [ "./wait-for-it.sh", "localhost:9200" ]
container_name: wait-for-it
restart: on-failure
networks:
shared:
ipv4_address: 10.10.10.95
elasticsearch:
image: docker.elastic.co/elasticsearch/elasticsearch-oss:6.8.15

View File

@ -0,0 +1,3 @@
FROM bash:5
COPY wait-for-it/wait-for-it.sh ./

@ -0,0 +1 @@
Subproject commit 81b1373f17855a4dc21156cfe1694c31d7d1792e