Files
owncloud/entrypoint.sh.tmpl
2026-11-25 16:04:39 +01:00

37 lines
790 B
Cheetah

#!/bin/bash
set -eu
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 "OWNCLOUD_DB_PASSWORD"
file_env "OWNCLOUD_ADMIN_PASSWORD"
#echo "Giving the db container some time to come up"; sleep 10
# see this issue with postgres db https://github.com/nextcloud/docker/issues/1204
# Required for healthcheck
which cgi-fcgi > /dev/null || (apt-get update && apt-get install -y libfcgi-bin)
/usr/bin/entrypoint /usr/bin/owncloud server