-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Manik2708
authored and
Manik2708
committed
Jun 3, 2024
1 parent
2fc7289
commit d3d9770
Showing
4 changed files
with
41 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
FROM node:18-alpine | ||
RUN apk update && apk add curl | ||
RUN npm install -g @nestjs/cli | ||
WORKDIR /usr/src/app | ||
COPY . . | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
version: "3" | ||
services: | ||
web: | ||
build: | ||
context: . | ||
dockerfile: Dockerfile | ||
user: "node:node" | ||
ports: | ||
- "3000:3000" | ||
networks: | ||
- hi-services | ||
healthcheck: | ||
test: curl --fail http://0.0.0.0:3000/health-check/container || exit 1 | ||
interval: 10s | ||
timeout: 3s | ||
retries: 3 | ||
start_period: 20s | ||
container_name: hi-container | ||
networks: | ||
hi-services: | ||
external: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import { Controller, Get, Req, Res } from '@nestjs/common'; | ||
import express from 'express'; | ||
|
||
@Controller('health-check') | ||
export class GlobalControllers { | ||
@Get('container') | ||
async containerHealthCheck( | ||
@Req() req: express.Request, | ||
@Res() res: express.Response, | ||
) { | ||
return res.status(200).send('Ok'); | ||
} | ||
} |