Skip to content

Commit bf35b05

Browse files
committed
Merge branch 'master' of github.com:CS3219-AY2324S1/ay2324s1-course-assessment-g10
2 parents 2e34146 + 0eabcca commit bf35b05

23 files changed

+2337
-43
lines changed

api_gateway/.dockerignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
node_modules
2+
npm-debug.log

api_gateway/Dockerfile

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
FROM node:18-alpine
2+
WORKDIR /usr/src/app
3+
COPY package*.json ./
4+
COPY tsconfig.json ./
5+
RUN npm install
6+
# RUN npm ci --omit=dev
7+
8+
COPY . .
9+
EXPOSE 7998-8000
10+
CMD ["npm", "run", "start"]

api_gateway/Dockerfile.prod

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
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"]

api_gateway/nodemon.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
2+
{
3+
"ignore": ["**/*.test.ts", "**/*.spec.ts", "node_modules"],
4+
"watch": ["src"],
5+
"exec": "npm start",
6+
"ext": "ts"
7+
}

0 commit comments

Comments
 (0)