From 5e36a4ac4cfbfbc152f45a0adfa302a5f4fa23cc Mon Sep 17 00:00:00 2001 From: gabrielavelino Date: Fri, 14 Jul 2023 17:43:29 -0300 Subject: [PATCH 1/3] #153 Set version and health check of postgres --- docker-compose.yml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/docker-compose.yml b/docker-compose.yml index 4ff75c5..801c1d7 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -34,6 +34,12 @@ services: - POSTGRES_USER=postgres - POSTGRES_PASSWORD=postgres - POSTGRES_DB=schedula_tutorial + healthcheck: + # Run command inside the container to check if postgres is ready AND alter DATABASE_DB + test: ["CMD-SHELL", "sh -c 'pg_isready -U $$POSTGRES_USER -d $$POSTGRES_DB'"] + interval: 5s + timeout: 5s + retries: 5 pgadmin: image: dpage/pgadmin4 @@ -43,4 +49,5 @@ services: ports: - "16546:80" depends_on: - - postgres \ No newline at end of file + postgres: + condition: service_healthy \ No newline at end of file From 644be0ab3225202c77a30e948c9649b09eb61990 Mon Sep 17 00:00:00 2001 From: gabrielavelino Date: Fri, 14 Jul 2023 17:46:54 -0300 Subject: [PATCH 2/3] #153 Defining alpine version --- docker-compose.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker-compose.yml b/docker-compose.yml index 801c1d7..ad22f89 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -24,7 +24,7 @@ services: - postgres postgres: - image: postgres:alpine + image: postgres:12-alpine container_name: schedula_tutorial_db ports: - "5106:5432" From a689fce4965f82cf2fe6d786dfad8acc900743f9 Mon Sep 17 00:00:00 2001 From: Gabriel Avelino <48573662+gabrielavelino@users.noreply.github.com> Date: Fri, 14 Jul 2023 18:00:25 -0300 Subject: [PATCH 3/3] #153 changes requested Co-authored-by: Ian Fillipe Pontes Ferreira --- docker-compose.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker-compose.yml b/docker-compose.yml index ad22f89..0fb84bb 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -21,7 +21,7 @@ services: - DATABASE_DB=schedula_tutorial - DATABASE_PORT=5432 depends_on: - - postgres + - pgadmin postgres: image: postgres:12-alpine