-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: add healthcheck to docker image (#536)
build: use docker node-alpine image
- Loading branch information
1 parent
679afa7
commit 813f564
Showing
10 changed files
with
37 additions
and
11 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,9 +1,12 @@ | ||
FROM node:20.11.1 | ||
FROM node:20-alpine | ||
ARG version=latest | ||
ENV NODE_ENV production | ||
USER node | ||
|
||
RUN mkdir /app | ||
WORKDIR /app | ||
RUN npm init --yes | ||
RUN npm install @stryker-mutator/dashboard-backend@$version | ||
|
||
HEALTHCHECK CMD npx dashboard-healthcheck | ||
EXPOSE 1337 | ||
ENTRYPOINT [ "npx", "dashboard-backend" ] |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,6 +1,6 @@ | ||
**/* | ||
!/badge/*.mjs | ||
!/dist/badge/**/*.js | ||
!/dist/badge/**/*.+(js|d.ts) | ||
!README.md | ||
!host.json | ||
!bin |
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,3 +1,3 @@ | ||
**/* | ||
!dist/src/**/*.+(js|.d.ts) | ||
!README.md | ||
!dist/src/**/*.+(js|d.ts) | ||
!README.md |
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,4 @@ | ||
**/* | ||
!/dist/src/**/*.js | ||
!/dist/src/**/*.+(js|d.ts) | ||
!README.md | ||
!bin | ||
!bin |
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,19 @@ | ||
#!/usr/bin/env node | ||
|
||
const response = await fetch(`http://localhost:1337/api/version`); | ||
|
||
if (!response.ok) { | ||
console.error( | ||
`Health check failed: ${response.status}: ${response.statusText}`, | ||
); | ||
process.exit(1); | ||
} | ||
|
||
const json = await response.json(); | ||
if (!json.dashboard || !json.frontend) { | ||
console.error(`Health check failed: invalid response`, json); | ||
process.exit(1); | ||
} | ||
console.log( | ||
`Health check passed. dashboard: ${json.dashboard}, frontend: ${json.frontend}`, | ||
); |
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
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