Skip to content

Commit be0e395

Browse files
authored
Merge pull request #4 from mcode/health-check
health check
2 parents 211eda4 + fd609aa commit be0e395

2 files changed

Lines changed: 14 additions & 2 deletions

File tree

Dockerfile

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,15 @@
11
FROM node:21-alpine
22
WORKDIR /home/node/app/rems-directory
33

4+
ARG SERVER_PORT
5+
ENV SERVER_PORT=$SERVER_PORT
6+
7+
ARG SERVER_HOST
8+
ENV SERVER_HOST=$SERVER_HOST
9+
410
COPY --chown=node:node . .
511
RUN npm install
612
EXPOSE 3323
713

8-
HEALTHCHECK --interval=30s --start-period=15s --timeout=10m --retries=10 CMD wget --no-verbose --tries=1 --spider http://localhost:33333/health || exit 1
14+
HEALTHCHECK --interval=30s --start-period=15s --timeout=10m --retries=10 CMD wget --no-verbose --tries=1 --spider http://${SERVER_HOST}:${SERVER_PORT}/health || exit 1
915
CMD npm run dev

Dockerfile.dev

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,16 @@
11
FROM node:21-alpine
22
WORKDIR /home/node/app/rems-directory
33

4+
ARG SERVER_PORT
5+
ENV SERVER_PORT=$SERVER_PORT
6+
7+
ARG SERVER_HOST
8+
ENV SERVER_HOST=$SERVER_HOST
9+
410
COPY --chown=node:node . .
511
RUN npm install
612
EXPOSE 3323
713
EXPOSE 3324
814

9-
HEALTHCHECK --interval=30s --start-period=15s --timeout=10m --retries=10 CMD wget --no-verbose --tries=1 --spider http://localhost:33333/health || exit 1
15+
HEALTHCHECK --interval=30s --start-period=15s --timeout=10m --retries=10 CMD wget --no-verbose --tries=1 --spider http://${SERVER_HOST}:${SERVER_PORT}/health || exit 1
1016
CMD ./dockerRunnerDev.sh

0 commit comments

Comments
 (0)