File tree Expand file tree Collapse file tree 6 files changed +51
-256
lines changed Expand file tree Collapse file tree 6 files changed +51
-256
lines changed Original file line number Diff line number Diff line change 21
21
"env-cmd" : " ^10.1.0" ,
22
22
"express" : " ^4.21.1" ,
23
23
"http-status-codes" : " ^2.3.0" ,
24
- "pg" : " ^8.13.0" ,
25
24
"pino" : " ^9.4.0" ,
26
25
"pino-http" : " ^10.3.0" ,
27
26
"redis" : " ^4.7.0" ,
Original file line number Diff line number Diff line change @@ -3,5 +3,3 @@ import 'dotenv/config';
3
3
export const UI_HOST = process . env . PEERPREP_UI_HOST ! ;
4
4
5
5
export const EXPRESS_PORT = process . env . EXPRESS_PORT ;
6
-
7
- export const WEBSOCKET_PORT = process . env . WEBSOCKET_PORT ;
Original file line number Diff line number Diff line change @@ -4,11 +4,9 @@ import { dbHealthCheck } from '@/server';
4
4
import server from '@/websocket' ;
5
5
6
6
const port = Number . parseInt ( EXPRESS_PORT || '8001' ) ;
7
- const wsPort = Number . parseInt ( WEBSOCKET_PORT || '8002' ) ;
8
7
9
8
const listenMessage = `App listening on port: ${ port } ` ;
10
9
server . listen ( port , ( ) => {
11
10
void dbHealthCheck ( ) ;
12
11
logger . info ( listenMessage ) ;
13
12
} ) ;
14
- server . listen ( wsPort , ( ) => logger . info ( `WebSocket listening on port: ${ wsPort } ` ) ) ;
Load Diff This file was deleted.
Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -76,6 +76,24 @@ services:
76
76
networks :
77
77
- match-db-network
78
78
79
+ collab-db :
80
+ hostname : ' collab-db'
81
+ image : postgres:16.4
82
+ container_name : ' collab-db'
83
+ env_file :
84
+ - ./backend/collaboration/.env.local
85
+ volumes :
86
+ - ' collab-db-docker:${COLLAB_PGDATA}'
87
+ restart : unless-stopped
88
+ networks :
89
+ - collab-db-network
90
+ healthcheck :
91
+ test : ['CMD-SHELL', 'pg_isready -U peerprep-collab-express -d collab']
92
+ interval : 10s
93
+ retries : 5
94
+ start_period : 30s
95
+ timeout : 10s
96
+
79
97
# Services
80
98
user-service :
81
99
image : ' user-express'
@@ -201,6 +219,37 @@ services:
201
219
retries : 5
202
220
start_period : 5s
203
221
222
+ collab-service :
223
+ image : ' collab-express'
224
+ container_name : ' ${COLLAB_SERVICE_NAME}'
225
+ build :
226
+ context : ./backend/collaboration
227
+ dockerfile : express.Dockerfile
228
+ target : production
229
+ args :
230
+ # For building with the correct env vars
231
+ - port=${COLLAB_EXPRESS_PORT}
232
+ env_file :
233
+ - ./backend/collaboration/.env.compose
234
+ environment :
235
+ # Docker Compose Specific for Service Discovery
236
+ - EXPRESS_DB_HOST=collab-db
237
+ - EXPRESS_DB_PORT=5432
238
+ - PEERPREP_UI_HOST=http://${FRONTEND_SERVICE_NAME}:${FRONTEND_PORT}
239
+ depends_on :
240
+ collab-db :
241
+ condition : service_healthy
242
+ restart : true
243
+ networks :
244
+ - collab-db-network
245
+ - collab-ws-network
246
+ healthcheck :
247
+ test : wget --no-verbose --tries=1 --spider http://localhost:${COLLAB_EXPRESS_PORT}/health || exit 1
248
+ interval : 30s
249
+ timeout : 10s
250
+ retries : 5
251
+ start_period : 5s
252
+
204
253
# Frontend
205
254
frontend :
206
255
image : ' frontend'
@@ -247,6 +296,8 @@ volumes:
247
296
# Redis Match server
248
297
match-db-docker :
249
298
external : true
299
+ collab-db-docker :
300
+ external : true
250
301
251
302
networks :
252
303
# Isolated API Server Networks
You can’t perform that action at this time.
0 commit comments