File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -7,26 +7,31 @@ services:
77 ports :
88 - " 8082:8082"
99 depends_on :
10- - postgres
10+ postgres :
11+ condition : service_healthy
1112 networks :
1213 - babab
1314
1415 postgres :
15- image : postgres:10.5
16- container_name : postgresDb
17- restart : always
18- environment :
19- - POSTGRES_DB=postgres
20- - POSTGRES_USER=postgres
21- - POSTGRES_PASSWORD=password
22- ports :
23- - ' 5432:5432'
24- volumes :
25- # - ./postgres-data:/var/lib/postgresql/data
26- # copy the sql script to create tables
27- - ./sql/init.sql:/docker-entrypoint-initdb.d/init.sql
28- networks :
29- - babab
16+ image : postgres:10.5
17+ container_name : postgresDb
18+ restart : always
19+ environment :
20+ - POSTGRES_DB=postgres
21+ - POSTGRES_USER=postgres
22+ - POSTGRES_PASSWORD=password
23+ ports :
24+ - ' 5432:5432'
25+ volumes :
26+ - ./sql/init.sql:/docker-entrypoint-initdb.d/init.sql
27+ networks :
28+ - babab
29+ healthcheck :
30+ test : ["CMD-SHELL", "pg_isready -U postgres -d postgres"]
31+ interval : 5s
32+ timeout : 5s
33+ retries : 5
34+ start_period : 30s
3035
3136networks :
3237 babab :
You can’t perform that action at this time.
0 commit comments