Skip to content

Commit

Permalink
build: add healthcheck to postgres containers
Browse files Browse the repository at this point in the history
  • Loading branch information
spwoodcock committed Oct 23, 2023
1 parent 103eb7e commit 1576b18
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 0 deletions.
6 changes: 6 additions & 0 deletions docker-compose.development.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,12 @@ services:
networks:
- fmtm-net
restart: "unless-stopped"
healthcheck:
test: pg_isready -U ${FMTM_DB_USER:-fmtm} -d ${FMTM_DB_NAME:-fmtm}
start_period: 5s
interval: 10s
timeout: 5s
retries: 3

api:
image: "ghcr.io/hotosm/fmtm/backend:${GIT_BRANCH}"
Expand Down
6 changes: 6 additions & 0 deletions docker-compose.main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,12 @@ services:
networks:
- fmtm-net
restart: "unless-stopped"
healthcheck:
test: pg_isready -U ${FMTM_DB_USER:-fmtm} -d ${FMTM_DB_NAME:-fmtm}
start_period: 5s
interval: 10s
timeout: 5s
retries: 3

api:
image: "ghcr.io/hotosm/fmtm/backend:${GIT_BRANCH}"
Expand Down
6 changes: 6 additions & 0 deletions docker-compose.noodk.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,12 @@ services:
networks:
- fmtm-dev
restart: "unless-stopped"
healthcheck:
test: pg_isready -U ${FMTM_DB_USER:-fmtm} -d ${FMTM_DB_NAME:-fmtm}
start_period: 5s
interval: 10s
timeout: 5s
retries: 3

api:
image: "ghcr.io/hotosm/fmtm/backend:debug"
Expand Down
14 changes: 14 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,12 @@ services:
networks:
- fmtm-dev
restart: "unless-stopped"
healthcheck:
test: pg_isready -U ${FMTM_DB_USER:-fmtm} -d ${FMTM_DB_NAME:-fmtm}
start_period: 5s
interval: 10s
timeout: 5s
retries: 3

api:
image: "ghcr.io/hotosm/fmtm/backend:${TAG_OVERRIDE:-debug}"
Expand Down Expand Up @@ -90,6 +96,8 @@ services:
- fmtm-dev
entrypoint: ["/migrate-entrypoint.sh"]
restart: "on-failure:3"
healthcheck:
test: [] # Set the health check test to an empty value to disable it

ui:
image: "ghcr.io/hotosm/fmtm/frontend:debug"
Expand Down Expand Up @@ -129,6 +137,12 @@ services:
networks:
- fmtm-dev
restart: "unless-stopped"
healthcheck:
test: pg_isready -U ${CENTRAL_DB_USER:-odk} -d ${CENTRAL_DB_NAME:-odk}
start_period: 5s
interval: 10s
timeout: 5s
retries: 3

central:
image: "ghcr.io/hotosm/fmtm/odkcentral:${ODK_CENTRAL_TAG:-v2023.4.0}"
Expand Down

0 comments on commit 1576b18

Please sign in to comment.