From d0e80dd11be5a1de6f532bbd24fda4b6cbc55793 Mon Sep 17 00:00:00 2001 From: Guillaume Kulakowski Date: Fri, 13 Oct 2023 17:46:52 +0200 Subject: [PATCH] Add healthcheck --- Dockerfile | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Dockerfile b/Dockerfile index 0d75a0f24..d3f4c5bde 100644 --- a/Dockerfile +++ b/Dockerfile @@ -11,6 +11,11 @@ COPY . /cryptpad RUN sed -i "s@//httpAddress: '::'@httpAddress: '0.0.0.0'@" /cryptpad/config/config.example.js RUN sed -i "s@installMethod: 'unspecified'@installMethod: 'docker'@" /cryptpad/config/config.example.js +# Install wget for healthcheck +RUN apt-get update && apt-get install --no-install-recommends -y wget && \ + apt-get clean && \ + rm -rf /var/lib/apt/lists/* + # Install dependencies RUN npm install --production \ && npm run install:components @@ -44,6 +49,9 @@ VOLUME /cryptpad/datastore ENTRYPOINT ["/bin/bash", "/cryptpad/docker-entrypoint.sh"] +# Healthcheck +HEALTHCHECK --interval=1m CMD wget --no-verbose --tries=1 http://localhost:3000/ -q -O /dev/null || exit 1 + # Ports EXPOSE 3000 3001 3003