File tree Expand file tree Collapse file tree 3 files changed +22
-10
lines changed Expand file tree Collapse file tree 3 files changed +22
-10
lines changed Original file line number Diff line number Diff line change 12
12
org.wikimedia.search:extra:${ELASTICSEARCH_PLUGIN_WIKIMEDIA_EXTRA} && \
13
13
./bin/elasticsearch-plugin install \
14
14
org.wikimedia.search.highlighter:experimental-highlighter-elasticsearch-plugin:${ELASTICSEARCH_PLUGIN_WIKIMEDIA_HIGHLIGHTER}
15
+ COPY healthcheck.sh /healthcheck.sh
15
16
COPY default.jvm.options /default.jvm.options
16
17
RUN cat /default.jvm.options >> /usr/share/elasticsearch/config/jvm.options && \
17
18
rm /default.jvm.options
18
-
Original file line number Diff line number Diff line change @@ -46,24 +46,22 @@ services:
46
46
DB_USER : " mariadb-user"
47
47
DB_PASS : " change-this-password"
48
48
ELASTICSEARCH_HOST : elasticsearch
49
- healthcheck :
50
- test : curl --silent --fail localhost/wiki/Main_Page
51
- interval : 10s
52
- start_period : 5m
53
49
depends_on :
54
50
mysql :
55
51
condition : service_healthy
56
52
restart : unless-stopped
53
+ healthcheck : /healthcheck.sh
57
54
58
55
wikibase-jobrunner :
59
56
image : wikibase/wikibase
60
57
volumes_from :
61
58
- wikibase
62
- command : /jobrunner-entrypoint.sh
63
59
depends_on :
64
60
wikibase :
65
61
condition : service_healthy
66
62
restart : always
63
+ environment :
64
+ IS_JOBRUNNER : true
67
65
68
66
mysql :
69
67
image : mariadb:10.11
@@ -89,10 +87,7 @@ services:
89
87
environment :
90
88
discovery.type : single-node
91
89
ES_JAVA_OPTS : -Xms512m -Xmx512m -Dlog4j2.formatMsgNoLookups=true
92
- healthcheck :
93
- test : curl --silent --fail localhost:9200
94
- interval : 10s
95
- start_period : 2m
90
+ healthcheck : /healthcheck.sh
96
91
97
92
volumes :
98
93
wikibase-image-data :
Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+
3
+ # Ref. https://github.com/docker-library/healthcheck/blob/master/elasticsearch/docker-healthcheck
4
+
5
+ set -eo pipefail
6
+
7
+ host=" $( hostname --ip-address || echo ' 127.0.0.1' ) "
8
+
9
+ if health=" $( curl -fsSL " http://$host :9200/_cat/health?h=status" ) " ; then
10
+ health=" $( echo " $health " | sed -r ' s/^[[:space:]]+|[[:space:]]+$//g' ) " # trim whitespace (otherwise we'll have "green ")
11
+ if [ " $health " = ' green' ]; then
12
+ exit 0
13
+ fi
14
+ echo >&2 " unexpected health status: $health "
15
+ fi
16
+
17
+ exit 1
You can’t perform that action at this time.
0 commit comments