-
Notifications
You must be signed in to change notification settings - Fork 5
/
Dockerfile.coordinator
31 lines (25 loc) · 881 Bytes
/
Dockerfile.coordinator
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
FROM syndbg/postgres-xl-base
ENV PG_COORD_HOST=0.0.0.0
ENV PG_COORD_PORT=5432
ENV PG_GTM_PORT=6666
ENV PG_USER_HEALTHCHECK=_healthcheck
COPY init/docker-entrypoint.sh /usr/local/bin
COPY init/coordinator.sh init.sh
ENTRYPOINT ["docker-entrypoint.sh"]
CMD postgres \
-D ${PGDATA} \
-h ${PG_COORD_HOST} \
-p ${PG_COORD_PORT} \
-c gtm_host=${PG_GTM_HOST} \
-c gtm_port=${PG_GTM_PORT} \
--coordinator
EXPOSE ${PG_COORD_PORT}
HEALTHCHECK CMD createuser -U ${PG_USER} ${PG_USER_HEALTHCHECK}; \
createdb -U ${PG_USER} ${PG_USER_HEALTHCHECK}; \
psql \
-h ${PG_COORD_HOST} \
-p ${PG_COORD_PORT} \
-U ${PG_USER_HEALTHCHECK} \
-c 'SELECT version()'; \
removedb -U ${PG_USER} ${PG_USER_HEALTHCHECK}; \
removeuser -U ${PG_USER} ${PG_USER_HEALTHCHECK} || false