Skip to content

Commit

Permalink
fix: healthcheck (#34)
Browse files Browse the repository at this point in the history
  • Loading branch information
vgorkavenko authored Sep 27, 2024
1 parent 8770820 commit 91d1d57
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
FROM node:20.12.1-bookworm-slim AS building

RUN apt-get update && apt-get install -y --no-install-recommends -qq \
curl=7.88.1-10+deb12u7 \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*

WORKDIR /app

COPY package.json yarn.lock build-info.json ./
Expand All @@ -9,7 +14,7 @@ COPY ./src ./src
RUN yarn install --frozen-lockfile --non-interactive && yarn cache clean && yarn typechain
RUN yarn build

FROM node:20.12.1-bookworm-slim
FROM building AS production

WORKDIR /app

Expand All @@ -22,6 +27,6 @@ RUN mkdir -p ./storage/ && chown -R node:node ./storage/
USER node

HEALTHCHECK --interval=120s --timeout=60s --retries=3 \
CMD sh -c "wget -nv -t1 --spider http://127.0.0.1:$HTTP_PORT/health" || exit 1
CMD curl -f http://localhost:$HTTP_PORT/health || exit 1

CMD ["yarn", "start:prod"]

0 comments on commit 91d1d57

Please sign in to comment.