Browse Source
Reduce healthcheck internal while keep performance
pull/4678/head
hellodword
10 months ago
No known key found for this signature in database
GPG Key ID: 94D44EBA7DBAE80
4 changed files with
12 additions and
4 deletions
-
docker/Dockerfile.alpine
-
docker/Dockerfile.debian
-
docker/Dockerfile.j2
-
docker/healthcheck.sh
|
@ -153,6 +153,6 @@ COPY docker/healthcheck.sh docker/start.sh / |
|
|
COPY --from=vault /web-vault ./web-vault |
|
|
COPY --from=vault /web-vault ./web-vault |
|
|
COPY --from=build /app/target/final/vaultwarden . |
|
|
COPY --from=build /app/target/final/vaultwarden . |
|
|
|
|
|
|
|
|
HEALTHCHECK --interval=60s --timeout=10s CMD ["/healthcheck.sh"] |
|
|
HEALTHCHECK --interval=3s --timeout=2s CMD ["/healthcheck.sh"] |
|
|
|
|
|
|
|
|
CMD ["/start.sh"] |
|
|
CMD ["/start.sh"] |
|
|
|
@ -196,6 +196,6 @@ COPY docker/healthcheck.sh docker/start.sh / |
|
|
COPY --from=vault /web-vault ./web-vault |
|
|
COPY --from=vault /web-vault ./web-vault |
|
|
COPY --from=build /app/target/final/vaultwarden . |
|
|
COPY --from=build /app/target/final/vaultwarden . |
|
|
|
|
|
|
|
|
HEALTHCHECK --interval=60s --timeout=10s CMD ["/healthcheck.sh"] |
|
|
HEALTHCHECK --interval=3s --timeout=2s CMD ["/healthcheck.sh"] |
|
|
|
|
|
|
|
|
CMD ["/start.sh"] |
|
|
CMD ["/start.sh"] |
|
|
|
@ -240,6 +240,6 @@ COPY docker/healthcheck.sh docker/start.sh / |
|
|
COPY --from=vault /web-vault ./web-vault |
|
|
COPY --from=vault /web-vault ./web-vault |
|
|
COPY --from=build /app/target/final/vaultwarden . |
|
|
COPY --from=build /app/target/final/vaultwarden . |
|
|
|
|
|
|
|
|
HEALTHCHECK --interval=60s --timeout=10s CMD ["/healthcheck.sh"] |
|
|
HEALTHCHECK --interval=3s --timeout=2s CMD ["/healthcheck.sh"] |
|
|
|
|
|
|
|
|
CMD ["/start.sh"] |
|
|
CMD ["/start.sh"] |
|
|
|
@ -1,5 +1,13 @@ |
|
|
#!/usr/bin/env sh |
|
|
#!/usr/bin/env sh |
|
|
|
|
|
|
|
|
|
|
|
LAST_HEALTHY_FILE="/tmp/healthy" |
|
|
|
|
|
|
|
|
|
|
|
last_check="$(cat "$LAST_HEALTHY_FILE" 2>/dev/null || echo "0")" |
|
|
|
|
|
current_time="$(date +%s)" |
|
|
|
|
|
if [ $((current_time - last_check)) -le 60 ]; then |
|
|
|
|
|
exit 0 |
|
|
|
|
|
fi |
|
|
|
|
|
|
|
|
# Use the value of the corresponding env var (if present), |
|
|
# Use the value of the corresponding env var (if present), |
|
|
# or a default value otherwise. |
|
|
# or a default value otherwise. |
|
|
: "${DATA_FOLDER:="/data"}" |
|
|
: "${DATA_FOLDER:="/data"}" |
|
@ -62,4 +70,4 @@ if [ -n "${ROCKET_TLS}" ]; then |
|
|
s='s' |
|
|
s='s' |
|
|
fi |
|
|
fi |
|
|
curl --insecure --fail --silent --show-error \ |
|
|
curl --insecure --fail --silent --show-error \ |
|
|
"http${s}://${addr}:${ROCKET_PORT}${base_path}/alive" || exit 1 |
|
|
"http${s}://${addr}:${ROCKET_PORT}${base_path}/alive" && echo "$current_time" > "$LAST_HEALTHY_FILE" || exit 1 |
|
|