File tree Expand file tree Collapse file tree 2 files changed +23
-3
lines changed Expand file tree Collapse file tree 2 files changed +23
-3
lines changed Original file line number Diff line number Diff line change 1
1
EXPRESS_ENV = " local"
2
2
EXPRESS_DB_HOST = " localhost"
3
3
EXPRESS_DB_PORT = 5434
4
- POSTGRES_DB = " collaboration "
4
+ POSTGRES_DB = " collab "
5
5
POSTGRES_USER = " peerprep-collab-express"
6
6
POSTGRES_PASSWORD = " /86awM+Izo6949YgEQIls8HU+j5RlFYEInRy8auiNa8="
7
7
PGDATA = " /data/collab-db"
Original file line number Diff line number Diff line change @@ -16,6 +16,12 @@ services:
16
16
restart : unless-stopped
17
17
networks :
18
18
- user-db-network
19
+ healthcheck :
20
+ test : ["CMD-SHELL", "pg_isready -U peerprep-user-express -d user"]
21
+ interval : 10s
22
+ retries : 5
23
+ start_period : 30s
24
+ timeout : 10s
19
25
20
26
collab-db :
21
27
hostname : " collab-db"
@@ -30,6 +36,12 @@ services:
30
36
restart : unless-stopped
31
37
networks :
32
38
- collab-db-network
39
+ healthcheck :
40
+ test : ["CMD-SHELL", "pg_isready -U peerprep-collab-express -d collab"]
41
+ interval : 10s
42
+ retries : 5
43
+ start_period : 30s
44
+ timeout : 10s
33
45
34
46
question-db :
35
47
hostname : " question-db"
@@ -44,6 +56,12 @@ services:
44
56
restart : unless-stopped
45
57
networks :
46
58
- question-db-network
59
+ healthcheck :
60
+ test : ["CMD-SHELL", "pg_isready -U peerprep-qn-express -d question"]
61
+ interval : 10s
62
+ retries : 5
63
+ start_period : 30s
64
+ timeout : 10s
47
65
48
66
# Services
49
67
@@ -63,13 +81,15 @@ services:
63
81
env_file :
64
82
- ./backend/user/.env.compose
65
83
environment :
66
- # Docker Compose Specific
84
+ # Docker Compose Specific for Service Discovery
67
85
- EXPRESS_DB_HOST=user-db
68
86
- EXPRESS_DB_PORT=5432
69
87
volumes :
70
88
- user-service:/data/user-express
71
89
depends_on :
72
- - user-db
90
+ user-db :
91
+ condition : service_healthy
92
+ restart : true
73
93
networks :
74
94
- user-db-network
75
95
- user-api-network
You can’t perform that action at this time.
0 commit comments