diff options
author | Mathijs van Veluw <[email protected]> | 2024-01-31 22:31:47 +0100 |
---|---|---|
committer | GitHub <[email protected]> | 2024-01-31 22:31:47 +0100 |
commit | 4438da39f9c9aa9d83d1dddbf06616ad287f70eb (patch) | |
tree | fc62fd7f2a5fff84c986a6f97d410bef3b2aaa28 /docker | |
parent | 0b2383ab56ea1714833ebbc3ffa0e65eeb5cd0ba (diff) | |
download | vaultwarden-4438da39f9c9aa9d83d1dddbf06616ad287f70eb.tar.gz vaultwarden-4438da39f9c9aa9d83d1dddbf06616ad287f70eb.zip |
Fix healthcheck when using .env file (#4299)1.30.3
It seems Debian based images see the `.env` file in the `pwd` path, but
sourcing it via `. .env` breaks. It does work if you provide the full
path `/.env`. Changed the default to `/.env`.
Alpine does not have an issue with both ways.
Diffstat (limited to 'docker')
-rwxr-xr-x | docker/healthcheck.sh | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/docker/healthcheck.sh b/docker/healthcheck.sh index 9d518c1a..2d892e80 100755 --- a/docker/healthcheck.sh +++ b/docker/healthcheck.sh @@ -1,17 +1,15 @@ -#!/bin/sh +#!/usr/bin/env sh # Use the value of the corresponding env var (if present), # or a default value otherwise. -: "${DATA_FOLDER:="data"}" +: "${DATA_FOLDER:="/data"}" : "${ROCKET_PORT:="80"}" +: "${ENV_FILE:="/.env"}" CONFIG_FILE="${DATA_FOLDER}"/config.json -# Check if there is a .env file configured +# Check if the $ENV_FILE file exist and is readable # If that is the case, load it into the environment before running any check -if [ -z "${ENV_FILE}" ]; then - ENV_FILE=".env" -fi if [ -r "${ENV_FILE}" ]; then # shellcheck disable=SC1090 . "${ENV_FILE}" |