diff --git a/tools/hashing-tool/Dockerfile b/tools/hashing-tool/Dockerfile index d4448bc..f3b2d94 100644 --- a/tools/hashing-tool/Dockerfile +++ b/tools/hashing-tool/Dockerfile @@ -7,19 +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 -RUN echo 'server { \ - listen 3071; \ - location / { \ - root /usr/share/nginx/html; \ - index index.html; \ - } \ -}' > /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; + } +} +