File tree Expand file tree Collapse file tree 3 files changed +40
-2
lines changed Expand file tree Collapse file tree 3 files changed +40
-2
lines changed Original file line number Diff line number Diff line change 1
- FROM node:18
1
+ FROM node:18-alpine
2
2
WORKDIR /usr/src/app
3
3
COPY package*.json ./
4
4
COPY tsconfig.json ./
5
5
RUN npm install
6
6
# RUN npm ci --omit=dev
7
7
8
8
COPY . .
9
- EXPOSE 8000
9
+ EXPOSE 7998- 8000
10
10
CMD ["npm" , "run" , "start" ]
Original file line number Diff line number Diff line change
1
+ FROM node:18-alpine AS builder
2
+
3
+ WORKDIR /app
4
+ COPY package*.json ./
5
+ RUN npm ci
6
+ COPY . .
7
+ RUN npm run build
8
+
9
+ # Stage 2: Setup the production environment
10
+ FROM node:18-alpine
11
+ WORKDIR /usr/src/app
12
+ COPY package*.json ./
13
+ RUN npm ci --only=production
14
+ COPY --from=builder /app/dist ./dist
15
+ EXPOSE 7998-8080
16
+
17
+ # Command to run the application
18
+ CMD ["node", "./dist/index.js"]
Original file line number Diff line number Diff line change @@ -11,6 +11,25 @@ services:
11
11
- REACT_APP_ENV_TYPE=prod
12
12
ports :
13
13
- " 80:80"
14
+
15
+ api-gateway :
16
+ container_name : api-gateway
17
+ image : asia-southeast1-docker.pkg.dev/cs3219-400714/peerprep/api-gateway:latest
18
+ build :
19
+ context : ./api_gateway
20
+ dockerfile : Dockerfile.prod
21
+ environment :
22
+ SECRET_KEY : ${SECRET_KEY}
23
+ ENV_TYPE : docker
24
+ ports :
25
+ - " 8000:8000"
26
+ - " 7999:7999"
27
+ - " 7998:7998"
28
+ depends_on :
29
+ - question-service
30
+ - user-service
31
+ - matching-service
32
+ - collab-service
14
33
15
34
question-service :
16
35
container_name : question-service
@@ -48,6 +67,7 @@ services:
48
67
environment :
49
68
PORT : 8081
50
69
SECRET_KEY : ${SECRET_KEY}
70
+ DATABASE_URL : ${DATABASE_URL}
51
71
ports :
52
72
- " 8081:8081"
53
73
depends_on :
You can’t perform that action at this time.
0 commit comments