We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents b29543a + 7136b07 commit a5cfa72Copy full SHA for a5cfa72
1 file changed
docker-compose.yml
@@ -12,6 +12,11 @@ services:
12
- 5432:5432
13
volumes:
14
- postgres_data:/var/lib/postgresql/data
15
+ healthcheck:
16
+ test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER}"]
17
+ interval: 2s
18
+ timeout: 5s
19
+ retries: 20
20
21
app:
22
build:
@@ -27,11 +32,12 @@ services:
27
32
ports:
28
33
- 8000:8000
29
34
depends_on:
30
- - db
35
+ db:
36
+ condition: service_healthy # <-- wait for DB to be ready
31
37
links:
38
- db
39
40
- .:/app
41
42
- postgres_data:
43
+ postgres_data:
0 commit comments