diff --git a/docker-compose.yml b/docker-compose.yml index 105878819..45b20bc28 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -14,6 +14,11 @@ services: POSTGRES_DB: ${POSTGRES_DB:-pokeapi} volumes: - pg_data:/var/lib/postgresql/data + healthcheck: + test: pg_isready + interval: 1s + timeout: 5s + retries: 10 restart: always app: @@ -28,8 +33,10 @@ services: - db - cache depends_on: - - db - - cache + db: + condition: service_healthy + cache: + condition: service_started restart: always web: