Skip to content

Commit 9510f57

Browse files
committed
*: healthcheck GTM, Coord, Data (not Proxy)
1 parent a82ce34 commit 9510f57

File tree

3 files changed

+10
-2
lines changed

3 files changed

+10
-2
lines changed

Dockerfile.coord.Dockerfile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,8 @@ ENV \
9696
PG_COORD_HOST=0.0.0.0 \
9797
PG_COORD_PORT=5432 \
9898
PG_GTM_HOST=db_gtm_1 \
99-
PG_GTM_PORT=6666
99+
PG_GTM_PORT=6666 \
100+
PG_USER_HEALTHCHECK=_healthcheck
100101
#-------------------------------------------------------------------------------
101102
COPY coord/init.sh .
102103

@@ -111,4 +112,6 @@ CMD postgres \
111112
--coordinator
112113

113114
EXPOSE ${PG_COORD_PORT}
115+
116+
HEALTHCHECK CMD createuser ${PG_USER_HEALTHCHECK} ; createdb ${PG_USER_HEALTHCHECK} ; psql -h ${PG_COORD_HOST} -p ${PG_COORD_PORT} -U ${PG_USER_HEALTHCHECK} -c 'SELECT version()' || false
114117
#===============================================================================

Dockerfile.data.Dockerfile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,8 @@ ENV \
9696
PG_DATA_HOST=0.0.0.0 \
9797
PG_DATA_PORT=5432 \
9898
PG_GTM_HOST=db_gtm_1 \
99-
PG_GTM_PORT=6666
99+
PG_GTM_PORT=6666 \
100+
PG_USER_HEALTHCHECK=_healthcheck
100101
#-------------------------------------------------------------------------------
101102
COPY data/init.sh .
102103

@@ -111,4 +112,6 @@ CMD postgres \
111112
--datanode
112113

113114
EXPOSE ${PG_DATA_PORT}
115+
116+
HEALTHCHECK CMD psql -h ${PG_DATA_HOST} -p ${PG_DATA_PORT} -U ${PG_USER_HEALTHCHECK} -c 'SELECT version()' || false
114117
#===============================================================================

Dockerfile.gtm.Dockerfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,4 +108,6 @@ CMD gtm \
108108
-l /dev/stdout
109109

110110
EXPOSE ${PG_GTM_PORT}
111+
112+
HEALTHCHECK CMD curl -fs http://${PG_GTM_HOST}:${PG_GTM_PORT} || false
111113
#===============================================================================

0 commit comments

Comments
 (0)