diff --git a/docker-compose.yml b/docker-compose.yml index a8facdf0..92fcee33 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -8,7 +8,7 @@ services: depends_on: # Our app does not work without our database # so this ensures our database is loaded first - - postgres + condition: service_healthy ports: - "8080:8080" volumes: @@ -42,7 +42,11 @@ services: # provided in the `docker-entrypoint-initdb.d` directory, this connects # our seed file to that directory so that it gets run - ./database-seed.sql:/docker-entrypoint-initdb.d/database-seed.sql - + healthcheck: + test: ["CMD-SHELL", "pg_isready"] + interval: 10s + timeout: 5s + retries: 5 # PostgreSQL pgAdmin panel accessible at http://localhost:16543/ pgadmin-compose: image: dpage/pgadmin4