From 56d90e6bc38f35fe3580d2c83780f74d1f7b6a6b Mon Sep 17 00:00:00 2001 From: Tom Moor Date: Sat, 22 Jun 2024 10:05:55 -0400 Subject: [PATCH] Add `HEALTHCHECK` into docker image (#7085) * Add wget into docker image * Add healthcheck --- Dockerfile.base | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Dockerfile.base b/Dockerfile.base index 4f621d42f0..2921296c20 100644 --- a/Dockerfile.base +++ b/Dockerfile.base @@ -6,6 +6,10 @@ WORKDIR $APP_PATH COPY ./package.json ./yarn.lock ./ COPY ./patches ./patches +RUN apt-get update \ + && apt-get install -y wget \ + && rm -rf /var/lib/apt/lists/* + RUN yarn install --no-optional --frozen-lockfile --network-timeout 1000000 && \ yarn cache clean @@ -17,3 +21,6 @@ RUN rm -rf node_modules RUN yarn install --production=true --frozen-lockfile --network-timeout 1000000 && \ yarn cache clean + +ENV PORT 3000 +HEALTHCHECK CMD wget -qO- http://localhost:${PORT}/_health | grep -q "OK" || exit 1