From a44aaafb579d9f58e775b6871eb4ebff69ec9878 Mon Sep 17 00:00:00 2001 From: Guillaume Kulakowski Date: Sun, 1 Nov 2026 17:33:53 +0100 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20Add=20HEALTHCHECK=20in=20Dockerfile?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .hadolint.yaml | 2 ++ Dockerfile | 2 ++ 2 files changed, 4 insertions(+) create mode 100644 .hadolint.yaml diff --git a/.hadolint.yaml b/.hadolint.yaml new file mode 100644 index 00000000..0aa5f7c3 --- /dev/null +++ b/.hadolint.yaml @@ -0,0 +1,2 @@ +ignored: + - DL3008 \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index 908bc3c4..5a4020f4 100644 --- a/Dockerfile +++ b/Dockerfile @@ -40,5 +40,7 @@ RUN chmod +x /usr/local/bin/tome-entrypoint VOLUME ["/data", "/books", "/bindery"] EXPOSE 8080 +HEALTHCHECK --interval=30s --timeout=5s --start-period=20s \ + CMD ["python", "-c", "import urllib.request,sys; sys.exit(0 if urllib.request.urlopen('http://127.0.0.1:8080/api/health', timeout=5) else 1)"] ENTRYPOINT ["tome-entrypoint"] CMD ["uvicorn", "backend.main:app", "--host", "0.0.0.0", "--port", "8080"]