@@ -16,7 +16,8 @@ services:
1616 expose :
1717 - " ${APP_PORT}"
1818 depends_on :
19- - postgres
19+ postgres :
20+ condition : service_healthy
2021 migration :
2122 container_name : vrt_migration
2223 build :
@@ -25,7 +26,8 @@ services:
2526 environment :
2627 DATABASE_URL : postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@postgres:5432/${POSTGRES_DB}
2728 depends_on :
28- - postgres
29+ postgres :
30+ condition : service_healthy
2931 postgres :
3032 container_name : postgres
3133 image : postgres:15.3-alpine3.18
@@ -40,20 +42,25 @@ services:
4042 - " ${POSTGRES_PORT}"
4143 volumes :
4244 - postgres:/var/lib/postgresql/data
43-
45+ healthcheck :
46+ test : ["CMD-SHELL", "pg_isready -d $$POSTGRES_DB -U $$POSTGRES_USER"]
47+ interval : 10s
48+ timeout : 120s
49+ retries : 10
4450 # Available at http://localhost:5050
45- pgadmin :
46- container_name : pgadmin4
47- # https://hub.docker.com/r/dpage/pgadmin4
48- # https://www.pgadmin.org/docs/pgadmin4/latest/release_notes_7_4.html
49- image : dpage/pgadmin4:7.4
50- restart : always
51- environment :
52- PGADMIN_DEFAULT_EMAIL :
[email protected] 53- PGADMIN_DEFAULT_PASSWORD : root
54- ports :
55- - " 5050:80"
56- depends_on :
57- - postgres
51+ # pgadmin:
52+ # container_name: pgadmin4
53+ # # https://hub.docker.com/r/dpage/pgadmin4
54+ # # https://www.pgadmin.org/docs/pgadmin4/latest/release_notes_7_4.html
55+ # image: dpage/pgadmin4:7.4
56+ # restart: always
57+ # environment:
58+ # PGADMIN_DEFAULT_EMAIL: [email protected] 59+ # PGADMIN_DEFAULT_PASSWORD: root
60+ # ports:
61+ # - "5050:80"
62+ # depends_on:
63+ # postgres:
64+ # condition: service_healthy
5865volumes :
5966 postgres:
0 commit comments