@@ -4,7 +4,7 @@ services:
4
4
# Databases
5
5
user-db :
6
6
hostname : ' user-db'
7
- image : postgres:16.4
7
+ image : ' postgres:16.4'
8
8
container_name : ' user-db'
9
9
build :
10
10
context : ./backend/user/src/lib/db
@@ -55,8 +55,6 @@ services:
55
55
restart : unless-stopped
56
56
networks :
57
57
- question-db-network
58
- ports :
59
- - 5433:5432
60
58
healthcheck :
61
59
test : ['CMD-SHELL', 'pg_isready -U peerprep-qn-express -d question']
62
60
interval : 10s
@@ -75,8 +73,6 @@ services:
75
73
args :
76
74
# For building with the correct env vars
77
75
- port=${USER_EXPRESS_PORT}
78
- ports :
79
- - ' 9001:${USER_EXPRESS_PORT}'
80
76
env_file :
81
77
- ./backend/user/.env.compose
82
78
environment :
@@ -91,24 +87,22 @@ services:
91
87
- user-db-network
92
88
- user-api-network
93
89
healthcheck :
94
- test : wget --no-verbose --tries=1 --spider http://localhost:9001 /health || exit 1
90
+ test : wget --no-verbose --tries=1 --spider http://localhost:${USER_EXPRESS_PORT} /health || exit 1
95
91
interval : 30s
96
92
timeout : 10s
97
93
retries : 5
98
94
start_period : 5s
99
95
100
96
question-service :
101
97
image : " question-express"
102
- container_name : " question-express "
98
+ container_name : ' ${QUESTION_SERVICE_NAME} '
103
99
build :
104
100
context : ./backend/question
105
101
dockerfile : express.Dockerfile
106
102
target : production
107
103
args :
108
104
# For building with the correct env vars
109
105
- port=${QUESTION_EXPRESS_PORT}
110
- ports :
111
- - " 9002:${QUESTION_EXPRESS_PORT}"
112
106
env_file :
113
107
- ./backend/question/.env.compose
114
108
environment :
@@ -123,7 +117,7 @@ services:
123
117
- question-db-network
124
118
- question-api-network
125
119
healthcheck :
126
- test : wget --no-verbose --tries=1 --spider http://localhost:9002 /health || exit 1
120
+ test : wget --no-verbose --tries=1 --spider http://localhost:${QUESTION_EXPRESS_PORT} /health || exit 1
127
121
interval : 30s
128
122
timeout : 10s
129
123
retries : 5
@@ -145,13 +139,15 @@ services:
145
139
- ./frontend/.env.compose
146
140
environment :
147
141
- VITE_USER_SERVICE=http://${USER_SERVICE_NAME}:${USER_EXPRESS_PORT}
148
- # #to remove localhost once integrating question
149
- - VITE_QUESTION_SERVICE=http://host.docker.internal:${QUESTION_EXPRESS_PORT}
142
+ - VITE_QUESTION_SERVICE=http://${QUESTION_SERVICE_NAME}:${QUESTION_EXPRESS_PORT}
150
143
- FRONTEND_PORT=${FRONTEND_PORT}
151
144
depends_on :
152
145
user-service :
153
146
condition : service_healthy
154
147
restart : true
148
+ question-service :
149
+ condition : service_healthy
150
+ restart : true
155
151
networks :
156
152
- user-api-network
157
153
- question-api-network
0 commit comments