Skip to content

Commit 7d82477

Browse files
authored
Merge pull request #159 from CS3219-AY2425S1/fix/build-cycle
update build cycle for api gateway
2 parents 62fee0b + 8d08746 commit 7d82477

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

api-gateway/Dockerfile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ FROM node:18-alpine AS base
33

44
# Install pnpm globally
55
RUN npm install -g pnpm
6+
RUN npm install -g typescript
67

78
# Set the working directory in the container
89
WORKDIR /app
@@ -22,7 +23,6 @@ COPY tsconfig.json ./
2223

2324
CMD ["pnpm", "dev"]
2425

25-
2626
# Production stage
2727
FROM base AS production
2828
ENV NODE_ENV=production
@@ -33,4 +33,6 @@ COPY tsconfig.json ./
3333

3434
EXPOSE ${PORT}
3535

36+
RUN pnpm build
37+
3638
CMD ["pnpm", "start"]

api-gateway/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"main": "index.js",
66
"scripts": {
77
"dev": "nodemon --exec ts-node src/app.ts",
8-
"start": "tsc && node dist/app.js",
8+
"start": "node dist/app.js",
99
"build": "tsc",
1010
"format": "prettier --write \"src/**/*.ts\"",
1111
"test": "echo \"Error: no test specified\" && exit 1",

api-gateway/src/app.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ app.use(express.json());
1717
app.use(cors()); // configured so any one can use
1818
app.options('*', cors());
1919

20-
// Health check route
20+
// Health check route, redeploy
2121
app.get('/', (req, res) => {
2222
res.status(200).send('OK');
2323
});

0 commit comments

Comments
 (0)