File tree Expand file tree Collapse file tree 8 files changed +56
-36
lines changed Expand file tree Collapse file tree 8 files changed +56
-36
lines changed Original file line number Diff line number Diff line change 1
1
EXPRESS_PORT=9005
2
- EXPRESS_DB_HOST=" chat-db"
2
+ EXPRESS_DB_HOST=chat-db
3
3
EXPRESS_DB_PORT=5435
4
- POSTGRES_DB=" chat"
5
- POSTGRES_USER=" peerprep-chat-express"
6
- POSTGRES_PASSWORD=" Xk8qEcEI2sizjfEn/lF6mLqiyBECjIHY3q6sdXf9poQ="
4
+ POSTGRES_DB=chat
5
+ POSTGRES_USER=peerprep-chat-express
6
+ POSTGRES_PASSWORD=Xk8qEcEI2sizjfEn/lF6mLqiyBECjIHY3q6sdXf9poQ=
7
7
PGDATA="/data/chat-db"
Original file line number Diff line number Diff line change @@ -5,5 +5,5 @@ EXPRESS_DB_HOST=localhost
5
5
EXPRESS_DB_PORT = 5435
6
6
POSTGRES_DB = chat
7
7
POSTGRES_USER = peerprep-chat-express
8
- POSTGRES_PASSWORD = ' Xk8qEcEI2sizjfEn/lF6mLqiyBECjIHY3q6sdXf9poQ='
8
+ POSTGRES_PASSWORD = Xk8qEcEI2sizjfEn/lF6mLqiyBECjIHY3q6sdXf9poQ=
9
9
PGDATA = /data/chat-db
Original file line number Diff line number Diff line change
1
+ #! /bin/sh
2
+
3
+ # Drizzle will handle its own logic to remove conflicts
4
+ npm run db:prod:migrate
5
+
6
+ # Checks admin table and will not seed if data exists
7
+ npm run db:prod:seed
8
+
9
+ rm -rf drizzle src tsconfig.json
10
+
11
+ npm uninstall tsx drizzle-kit
12
+
13
+ npm run start
Original file line number Diff line number Diff line change 1
1
FROM node:lts-alpine AS build
2
- WORKDIR /data/collab -express
2
+ WORKDIR /data/chat -express
3
3
COPY package*.json ./
4
4
RUN npm install
5
- ARG env
6
5
COPY . .
7
6
RUN npm run build
8
7
9
8
FROM node:lts-alpine AS production
10
- WORKDIR /data/collab -express
11
- COPY --from=build /data/collab -express/package*.json ./
12
- COPY --from=build --chown=node:node /data/collab -express/dist ./dist
9
+ WORKDIR /data/chat -express
10
+ COPY --from=build /data/chat -express/package*.json ./
11
+ COPY --from=build --chown=node:node /data/chat -express/dist ./dist
13
12
14
13
RUN npm ci --omit=dev
15
14
16
- RUN sed -i 's|./ws|ws|g' ./dist/ws.js
17
-
15
+ COPY src/lib/db ./src/lib/db
16
+ COPY src/lib/utils ./src/lib/utils
17
+ COPY src/config.ts ./src
18
+ COPY tsconfig.json .
18
19
COPY entrypoint.sh .
19
20
20
21
ARG port
Original file line number Diff line number Diff line change 22
22
"license" : " ISC" ,
23
23
"description" : " " ,
24
24
"dependencies" : {
25
+ "dotenv" : " ^16.4.5" ,
25
26
"drizzle-orm" : " ^0.33.0" ,
26
27
"express" : " ^4.21.0" ,
27
28
"http" : " ^0.0.1-security" ,
28
29
"http-status-codes" : " ^2.3.0" ,
29
30
"pino" : " ^9.4.0" ,
30
31
"pino-http" : " ^10.3.0" ,
31
32
"postgres" : " ^3.4.4" ,
32
- "socket.io" : " ^4.8.1"
33
+ "socket.io" : " ^4.8.1" ,
34
+ "tsc-alias" : " ^1.8.10" ,
35
+ "tsx" : " ^4.19.1"
33
36
},
34
37
"devDependencies" : {
35
38
"@types/express" : " ^4.17.21" ,
36
39
"@types/node" : " ^22.5.5" ,
37
40
"drizzle-kit" : " ^0.24.2" ,
38
41
"nodemon" : " ^3.1.4" ,
39
42
"pino-pretty" : " ^11.2.2" ,
40
- "ts-node" : " ^10.9.2"
43
+ "ts-node" : " ^10.9.2" ,
44
+ "tsx" : " ^4.19.1" ,
45
+ "typescript" : " ^5.6.3"
41
46
}
42
47
}
Original file line number Diff line number Diff line change @@ -70,7 +70,7 @@ services:
70
70
build :
71
71
context : ./backend/chat/src/lib/db
72
72
env_file :
73
- - ./backend/chat/.env.local
73
+ - ./backend/chat/.env.compose
74
74
volumes :
75
75
- ' chat-db-docker:${CHAT_PGDATA}'
76
76
# - ./init.sql:/docker-entrypoint-initdb.d/init.sql
@@ -246,7 +246,7 @@ services:
246
246
environment :
247
247
# Docker Compose Specific for Service Discovery
248
248
- EXPRESS_DB_HOST=chat-db
249
- - EXPRESS_DB_PORT=5435
249
+ - EXPRESS_DB_PORT=5432
250
250
- PEERPREP_UI_HOST=http://${FRONTEND_SERVICE_NAME}:${FRONTEND_PORT}
251
251
depends_on :
252
252
chat-db :
@@ -282,6 +282,7 @@ services:
282
282
- VITE_COLLAB_SERVICE=http://${COLLAB_SERVICE_NAME}:${COLLAB_EXPRESS_PORT}
283
283
- VITE_COLLAB_WS=ws://${COLLAB_SERVICE_NAME}:${COLLAB_EXPRESS_PORT}
284
284
- VITE_MATCHING_SERVICE=http://${MATCHING_SERVICE_NAME}:${MATCHING_EXPRESS_PORT}
285
+ - VITE_CHAT_SERVICE=http://${CHAT_SERVICE_NAME}:${CHAT_EXPRESS_PORT}
285
286
- FRONTEND_PORT=${FRONTEND_PORT}
286
287
depends_on :
287
288
user-service :
@@ -298,6 +299,7 @@ services:
298
299
- question-api-network
299
300
- match-api-network
300
301
- collab-api-network
302
+ - chat-api-network
301
303
302
304
volumes :
303
305
# Persistent Volumes for Databases
Original file line number Diff line number Diff line change @@ -70,7 +70,7 @@ server {
70
70
proxy_set_header X-Forwarded-Proto $scheme;
71
71
}
72
72
73
- location /matching -socket/ {
73
+ location /chat -socket/ {
74
74
proxy_pass ${VITE_CHAT_SERVICE};
75
75
proxy_http_version 1.1;
76
76
proxy_set_header Upgrade $http_upgrade;
You can’t perform that action at this time.
0 commit comments