diff --git a/README.md b/README.md index b63a2460f6..0261be1f6d 100644 --- a/README.md +++ b/README.md @@ -24,11 +24,11 @@ Please visit [our documentation](https://develop.sentry.dev/self-hosted/) for ev ### Customize DotEnv (.env) file -Environment specific configurations can be done in the `.env.custom` file. It will be located in the root directory of the Sentry installation. +Environment specific configurations can be done in the `.env.custom` file. It will be located in the root directory of the Sentry installation, and if it exists then `.env` will be ignored entirely. By default, there exists no `.env.custom` file. In this case, you can manually add this file by copying the `.env` file to a new `.env.custom` file and adjust your settings in the `.env.custom` file. -Please keep in mind to check the `.env` file for changes, when you perform an upgrade of Sentry, so that you can adjust your `.env.custom` accordingly, if required. +Please keep in mind to check the `.env` file for changes, when you perform an upgrade of Sentry, so that you can adjust your `.env.custom` accordingly, if required, as `.env` is ignored entirely if `.env.custom` is present. ### Enhance Sentry image diff --git a/install/_lib.sh b/install/_lib.sh index f8a104b4a0..3080c8d6d7 100644 --- a/install/_lib.sh +++ b/install/_lib.sh @@ -15,11 +15,13 @@ else cd "$(dirname $0)" # assume we're a test script or some such fi -# Allow `.env` overrides using the `.env.custom` file -if [[ -f "../.env.custom" ]]; then - _ENV="$(realpath ../.env.custom)" +# Allow `.env` overrides using the `.env.custom` file. +# We pass this to docker compose in a couple places. +basedir="$( cd .. ; pwd -P )" # realpath is missing on stock macOS +if [[ -f "$basedir/.env.custom" ]]; then + _ENV="$basedir/.env.custom" else - _ENV="$(realpath ../.env)" + _ENV="$basedir/.env" fi # Read .env for default values with a tip o' the hat to https://stackoverflow.com/a/59831605/90297