commit 66a68f6d2258a0c5b262ee7687217334e1daffdc
parent 026f9da035dcbf5ff12387600162841f94b47154
Author: H3npi <H3npi@users.noreply.github.com>
Date: Tue, 27 Aug 2019 11:23:55 +0200
Adds Healthcheck for all docker container
Diffstat:
11 files changed, 50 insertions(+), 0 deletions(-)
diff --git a/docker/aarch64/mysql/Dockerfile b/docker/aarch64/mysql/Dockerfile
@@ -97,5 +97,9 @@ COPY Rocket.toml .
COPY --from=vault /web-vault ./web-vault
COPY --from=build /app/target/aarch64-unknown-linux-gnu/release/bitwarden_rs .
+COPY docker/healthcheck.sh ./healthcheck.sh
+
+HEALTHCHECK --interval=10s --timeout=1s CMD bash healthcheck.sh || exit 1
+
# Configures the startup!
CMD ["./bitwarden_rs"]
\ No newline at end of file
diff --git a/docker/aarch64/sqlite/Dockerfile b/docker/aarch64/sqlite/Dockerfile
@@ -97,5 +97,9 @@ COPY Rocket.toml .
COPY --from=vault /web-vault ./web-vault
COPY --from=build /app/target/aarch64-unknown-linux-gnu/release/bitwarden_rs .
+COPY docker/healthcheck.sh ./healthcheck.sh
+
+HEALTHCHECK --interval=10s --timeout=1s CMD bash healthcheck.sh || exit 1
+
# Configures the startup!
CMD ["./bitwarden_rs"]
\ No newline at end of file
diff --git a/docker/amd64/mysql/Dockerfile b/docker/amd64/mysql/Dockerfile
@@ -94,5 +94,9 @@ COPY Rocket.toml .
COPY --from=vault /web-vault ./web-vault
COPY --from=build app/target/release/bitwarden_rs .
+COPY docker/healthcheck.sh ./healthcheck.sh
+
+HEALTHCHECK --interval=10s --timeout=1s CMD bash healthcheck.sh || exit 1
+
# Configures the startup!
CMD ["./bitwarden_rs"]
\ No newline at end of file
diff --git a/docker/amd64/mysql/Dockerfile.alpine b/docker/amd64/mysql/Dockerfile.alpine
@@ -76,5 +76,9 @@ COPY Rocket.toml .
COPY --from=vault /web-vault ./web-vault
COPY --from=build /app/target/x86_64-unknown-linux-musl/release/bitwarden_rs .
+COPY docker/healthcheck.sh ./healthcheck.sh
+
+HEALTHCHECK --interval=10s --timeout=1s CMD bash healthcheck.sh || exit 1
+
# Configures the startup!
CMD ["./bitwarden_rs"]
\ No newline at end of file
diff --git a/docker/amd64/sqlite/Dockerfile b/docker/amd64/sqlite/Dockerfile
@@ -94,5 +94,9 @@ COPY Rocket.toml .
COPY --from=vault /web-vault ./web-vault
COPY --from=build app/target/release/bitwarden_rs .
+COPY docker/healthcheck.sh ./healthcheck.sh
+
+HEALTHCHECK --interval=10s --timeout=1s CMD bash healthcheck.sh || exit 1
+
# Configures the startup!
CMD ["./bitwarden_rs"]
diff --git a/docker/amd64/sqlite/Dockerfile.alpine b/docker/amd64/sqlite/Dockerfile.alpine
@@ -76,5 +76,10 @@ COPY Rocket.toml .
COPY --from=vault /web-vault ./web-vault
COPY --from=build /app/target/x86_64-unknown-linux-musl/release/bitwarden_rs .
+COPY docker/healthcheck.sh ./healthcheck.sh
+
+HEALTHCHECK --interval=10s --timeout=1s CMD bash healthcheck.sh || exit 1
+
+
# Configures the startup!
CMD ["./bitwarden_rs"]
diff --git a/docker/armv6/mysql/Dockerfile b/docker/armv6/mysql/Dockerfile
@@ -97,5 +97,9 @@ COPY Rocket.toml .
COPY --from=vault /web-vault ./web-vault
COPY --from=build /app/target/arm-unknown-linux-gnueabi/release/bitwarden_rs .
+COPY docker/healthcheck.sh ./healthcheck.sh
+
+HEALTHCHECK --interval=10s --timeout=1s CMD bash healthcheck.sh || exit 1
+
# Configures the startup!
CMD ["./bitwarden_rs"]
diff --git a/docker/armv6/sqlite/Dockerfile b/docker/armv6/sqlite/Dockerfile
@@ -97,5 +97,9 @@ COPY Rocket.toml .
COPY --from=vault /web-vault ./web-vault
COPY --from=build /app/target/arm-unknown-linux-gnueabi/release/bitwarden_rs .
+COPY docker/healthcheck.sh ./healthcheck.sh
+
+HEALTHCHECK --interval=10s --timeout=1s CMD bash healthcheck.sh || exit 1
+
# Configures the startup!
CMD ["./bitwarden_rs"]
diff --git a/docker/armv7/mysql/Dockerfile b/docker/armv7/mysql/Dockerfile
@@ -98,5 +98,9 @@ COPY Rocket.toml .
COPY --from=vault /web-vault ./web-vault
COPY --from=build /app/target/armv7-unknown-linux-gnueabihf/release/bitwarden_rs .
+COPY docker/healthcheck.sh ./healthcheck.sh
+
+HEALTHCHECK --interval=10s --timeout=1s CMD bash healthcheck.sh || exit 1
+
# Configures the startup!
CMD ["./bitwarden_rs"]
\ No newline at end of file
diff --git a/docker/armv7/sqlite/Dockerfile b/docker/armv7/sqlite/Dockerfile
@@ -97,5 +97,9 @@ COPY Rocket.toml .
COPY --from=vault /web-vault ./web-vault
COPY --from=build /app/target/armv7-unknown-linux-gnueabihf/release/bitwarden_rs .
+COPY docker/healthcheck.sh ./healthcheck.sh
+
+HEALTHCHECK --interval=10s --timeout=1s CMD bash healthcheck.sh || exit 1
+
# Configures the startup!
CMD ["./bitwarden_rs"]
\ No newline at end of file
diff --git a/docker/healthcheck.sh b/docker/healthcheck.sh
@@ -0,0 +1,8 @@
+#!/usr/bin/env sh
+
+if [ -z "$ROCKET_TLS"]
+then
+ curl --fail http://localhost/alive || exit 1
+else
+ curl --fail https://localhost/alive || exit 1
+fi
+\ No newline at end of file