From 8554e3b06c5a87267a8d61b9f732477484e119c0 Mon Sep 17 00:00:00 2001 From: SamuelBoerlin <11892708+SamuelBoerlin@users.noreply.github.com> Date: Thu, 5 Jan 2023 12:33:11 +0100 Subject: [PATCH] chore: add docker healthcheck to SIPI image (INFRA-130) (#2359) --- build.sbt | 4 ++++ sipi/scripts/healthcheck.sh | 3 +++ 2 files changed, 7 insertions(+) create mode 100755 sipi/scripts/healthcheck.sh diff --git a/build.sbt b/build.sbt index 3808f428e8..0d4faef4fd 100644 --- a/build.sbt +++ b/build.sbt @@ -110,6 +110,10 @@ lazy val sipi: Project = Project(id = "sipi", base = file("sipi")) Universal / mappings ++= { directory("sipi/scripts") }, + dockerCommands += Cmd( + """HEALTHCHECK --interval=15s --timeout=5s --retries=3 --start-period=30s \ + |CMD bash /sipi/scripts/healthcheck.sh || exit 1""".stripMargin + ), // use filterNot to return all items that do NOT meet the criteria dockerCommands := dockerCommands.value.filterNot { diff --git a/sipi/scripts/healthcheck.sh b/sipi/scripts/healthcheck.sh new file mode 100755 index 0000000000..67811872e3 --- /dev/null +++ b/sipi/scripts/healthcheck.sh @@ -0,0 +1,3 @@ +#!/bin/bash + +curl -sS --fail 'http://localhost:1024/server/test.html'