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: kratos-migrate:
image: oryd/kratos:v0.5.5-alpha.1 image: oryd/kratos:v0.5.5-alpha.1
container_name: kratos-migrate container_name: kratos-migrate
restart: "no" restart: off
logging: *default-logging logging: *default-logging
environment: 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 - 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_HOST=jaeger-agent
- JAEGER_AGENT_PORT=6831 - JAEGER_AGENT_PORT=6831
- JAEGER_REPORTER_LOG_SPANS=false - JAEGER_REPORTER_LOG_SPANS=false
depends_on:
- jaeger-agent
jaeger-agent: jaeger-agent:
image: jaegertracing/jaeger-agent image: jaegertracing/jaeger-agent
@ -49,7 +47,7 @@ services:
shared: shared:
ipv4_address: 10.10.10.91 ipv4_address: 10.10.10.91
depends_on: depends_on:
- elasticsearch - wait-for-it
jaeger-query: jaeger-query:
image: jaegertracing/jaeger-query image: jaegertracing/jaeger-query
@ -67,7 +65,18 @@ services:
shared: shared:
ipv4_address: 10.10.10.92 ipv4_address: 10.10.10.92
depends_on: 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: elasticsearch:
image: docker.elastic.co/elasticsearch/elasticsearch-oss:6.8.15 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