Skip to content

Commit

Permalink
Merge branch 'master' of github.com:CS3219-AY2324S1/ay2324s1-course-a…
Browse files Browse the repository at this point in the history
…ssessment-g10
  • Loading branch information
cheehongw committed Nov 14, 2023
2 parents 2e34146 + 0eabcca commit bf35b05
Show file tree
Hide file tree
Showing 23 changed files with 2,337 additions and 43 deletions.
2 changes: 2 additions & 0 deletions api_gateway/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
node_modules
npm-debug.log
10 changes: 10 additions & 0 deletions api_gateway/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
FROM node:18-alpine
WORKDIR /usr/src/app
COPY package*.json ./
COPY tsconfig.json ./
RUN npm install
# RUN npm ci --omit=dev

COPY . .
EXPOSE 7998-8000
CMD ["npm", "run", "start"]
18 changes: 18 additions & 0 deletions api_gateway/Dockerfile.prod
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
FROM node:18-alpine AS builder

WORKDIR /app
COPY package*.json ./
RUN npm ci
COPY . .
RUN npm run build

# Stage 2: Setup the production environment
FROM node:18-alpine
WORKDIR /usr/src/app
COPY package*.json ./
RUN npm ci --only=production
COPY --from=builder /app/dist ./dist
EXPOSE 7998-8080

# Command to run the application
CMD ["node", "./dist/index.js"]
7 changes: 7 additions & 0 deletions api_gateway/nodemon.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@

{
"ignore": ["**/*.test.ts", "**/*.spec.ts", "node_modules"],
"watch": ["src"],
"exec": "npm start",
"ext": "ts"
}
Loading

0 comments on commit bf35b05

Please sign in to comment.