Skip to content

Commit fbefdec

Browse files
authored
fix(docker): add a healthcheck and depends on for webserver to wait for elasticsearch (#55)
1 parent fa4aa7a commit fbefdec

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

docker-compose.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,19 @@ services:
77
ports:
88
- "9200:9200"
99

10+
healthcheck:
11+
test:
12+
- CMD-SHELL
13+
- |
14+
curl -fs http://localhost:9200/_cluster/health \
15+
| grep -E '"status":"(green|yellow)"' \
16+
|| exit 1
17+
interval: 15s
18+
timeout: 10s
19+
retries: 5
20+
start_period: 30s
21+
22+
1023
conjugador-server:
1124
image: conjugador-webserver
1225
build:
@@ -16,3 +29,6 @@ services:
1629
ES_URL: "http://conjugador-elastic:9200"
1730
ports:
1831
- "8000:8000"
32+
depends_on:
33+
conjugador-elastic:
34+
condition: service_healthy

0 commit comments

Comments
 (0)