with command

This commit is contained in:
val
2025-06-14 11:18:17 +02:00
parent 4954511131
commit 3c467307fb
5 changed files with 63 additions and 6 deletions

32
entrypoint.sh Normal file
View File

@ -0,0 +1,32 @@
#!/bin/bash
set -e
file_env() {
local var="$1"
local fileVar="${var}_FILE"
local def="${2:-}"
if [ "${!var:-}" ] && [ "${!fileVar:-}" ]; then
echo >&2 "error: both $var and $fileVar are set (but are exclusive)"
exit 1
fi
local val="$def"
if [ "${!var:-}" ]; then
val="${!var}"
elif [ "${!fileVar:-}" ]; then
val="$(< "${!fileVar}")"
fi
export "$var"="$val"
unset "$fileVar"
}
file_env "database__connection__password"
file_env "mail__options__auth__pass"
# upstream entrypoint https://github.com/docker-library/ghost/blob/master/5/alpine/Dockerfile
/usr/local/bin/docker-entrypoint.sh "$@"