Skip to content

Commit 2429038

Browse files
committed
add healthcheck for postgres/redis
1 parent b81744c commit 2429038

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

services/docker-compose.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -272,6 +272,10 @@ services:
272272
- default
273273
- interactive_services_subnet
274274
- computational_services_subnet
275+
healthcheck:
276+
test: ["CMD", "pg_isready", "-U", "${POSTGRES_USER}"]
277+
interval: 15s
278+
retries: 5
275279
# NOTES: this is not yet compatible with portainer deployment but could work also for other containers
276280
# works with Docker 19.03 and not yet with Portainer 1.23.0 (see https://github.com/portainer/portainer/issues/3551)
277281
# in the meantime postgres allows to set a configuration through CLI.
@@ -299,6 +303,11 @@ services:
299303
networks:
300304
- default
301305
- computational_services_subnet
306+
healthcheck:
307+
test: ["CMD", "redis-cli", "ping"]
308+
interval: 5s
309+
timeout: 30s
310+
retries: 50
302311

303312
traefik:
304313
image: traefik:v2.2.1

0 commit comments

Comments
 (0)