add healthcheck to compose

This commit is contained in:
Roy Crihfield 2024-06-28 19:27:35 +08:00
parent f49c43875b
commit 636e8ccbe7

View File

@ -2,13 +2,14 @@ services:
migrations:
restart: on-failure
depends_on:
- ipld-eth-db
ipld-eth-db:
condition: service_healthy
# Use local build
build:
context: .
dockerfile: Dockerfile
# Use an existing image
image: cerc/ipld-eth-db
image: cerc/ipld-eth-db:local
environment:
DATABASE_USER: "vdbm"
DATABASE_NAME: "cerc_testing"
@ -26,3 +27,8 @@ services:
POSTGRES_PASSWORD: "password"
ports:
- "127.0.0.1:8077:5432"
healthcheck:
test: ["CMD", "pg_isready", "-U", "vdbm"]
interval: 2s
timeout: 1s
retries: 3