From 94fd82458623856393d0d7666e9aedb6e9719a98 Mon Sep 17 00:00:00 2001 From: Eiman Eltigani Date: Tue, 16 Dec 2025 14:19:13 -0700 Subject: [PATCH 1/2] add health check to dockerfile --- tools/hashing-tool/Dockerfile | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tools/hashing-tool/Dockerfile b/tools/hashing-tool/Dockerfile index d4448bc..b40a05e 100644 --- a/tools/hashing-tool/Dockerfile +++ b/tools/hashing-tool/Dockerfile @@ -11,13 +11,18 @@ COPY app.css /usr/share/nginx/html/app.css COPY entrypoint.sh /entrypoint.sh RUN chmod +x /entrypoint.sh -# Configure nginx to serve on port 3071 +# Configure nginx to serve on port 3071 with healthcheck RUN echo 'server { \ listen 3071; \ location / { \ root /usr/share/nginx/html; \ index index.html; \ } \ + location = /ops/healthcheck { \ + access_log off; \ + return 200 "OK"; \ + add_header Content-Type text/plain; \ + } \ }' > /etc/nginx/conf.d/default.conf EXPOSE 3071 From e061bda6ca0f38ffd1a90135c6f038304644073b Mon Sep 17 00:00:00 2001 From: Eiman Eltigani Date: Tue, 16 Dec 2025 14:24:51 -0700 Subject: [PATCH 2/2] remove inline in docker to view updated changes --- tools/hashing-tool/Dockerfile | 18 ++++-------------- tools/hashing-tool/default.conf | 17 +++++++++++++++++ 2 files changed, 21 insertions(+), 14 deletions(-) create mode 100644 tools/hashing-tool/default.conf diff --git a/tools/hashing-tool/Dockerfile b/tools/hashing-tool/Dockerfile index b40a05e..f3b2d94 100644 --- a/tools/hashing-tool/Dockerfile +++ b/tools/hashing-tool/Dockerfile @@ -7,24 +7,14 @@ RUN apk add --no-cache gettext COPY index.html /usr/share/nginx/html/index.html COPY app.css /usr/share/nginx/html/app.css +# Copy nginx config +COPY default.conf /etc/nginx/conf.d/default.conf + # Copy entrypoint script COPY entrypoint.sh /entrypoint.sh RUN chmod +x /entrypoint.sh -# Configure nginx to serve on port 3071 with healthcheck -RUN echo 'server { \ - listen 3071; \ - location / { \ - root /usr/share/nginx/html; \ - index index.html; \ - } \ - location = /ops/healthcheck { \ - access_log off; \ - return 200 "OK"; \ - add_header Content-Type text/plain; \ - } \ -}' > /etc/nginx/conf.d/default.conf - EXPOSE 3071 ENTRYPOINT ["/entrypoint.sh"] +CMD ["nginx", "-g", "daemon off;"] diff --git a/tools/hashing-tool/default.conf b/tools/hashing-tool/default.conf new file mode 100644 index 0000000..dff00bb --- /dev/null +++ b/tools/hashing-tool/default.conf @@ -0,0 +1,17 @@ +server { + listen 3071; + + # Healthcheck endpoint for Kubernetes probes + location = /ops/healthcheck { + access_log off; + return 200 "healthy\n"; + add_header Content-Type text/plain; + } + + location / { + root /usr/share/nginx/html; + index index.html; + try_files $uri $uri/ =404; + } +} +