From bba0206bb7800b5aa4e12414e3b872f230f9917d Mon Sep 17 00:00:00 2001 From: Kyle Spearrin Date: Fri, 26 Jul 2019 12:43:06 -0400 Subject: [PATCH] alive check for nginx --- util/Nginx/Dockerfile | 3 +++ util/Setup/Templates/NginxConfig.hbs | 5 +++++ 2 files changed, 8 insertions(+) diff --git a/util/Nginx/Dockerfile b/util/Nginx/Dockerfile index 860a6dc51b..2ecbd46c0e 100644 --- a/util/Nginx/Dockerfile +++ b/util/Nginx/Dockerfile @@ -5,6 +5,7 @@ LABEL com.bitwarden.product="bitwarden" RUN apt-get update \ && apt-get install -y --no-install-recommends \ gosu \ + curl \ && rm -rf /var/lib/apt/lists/* COPY nginx.conf /etc/nginx @@ -19,4 +20,6 @@ EXPOSE 8443 RUN chmod +x /entrypoint.sh +HEALTHCHECK curl -L -f http://localhost/alive || exit 1 + ENTRYPOINT ["/entrypoint.sh"] diff --git a/util/Setup/Templates/NginxConfig.hbs b/util/Setup/Templates/NginxConfig.hbs index 88f76e0d56..28d733851f 100644 --- a/util/Setup/Templates/NginxConfig.hbs +++ b/util/Setup/Templates/NginxConfig.hbs @@ -69,6 +69,11 @@ server { add_header X-Robots-Tag "noindex, nofollow"; } + location /alive { + return 200 'alive'; + add_header Content-Type text/plain; + } + location = /app-id.json { proxy_pass http://web:5000/app-id.json; {{#if Ssl}}