vaultwarden/overlay/usr/local/bin/entrypoint

18 lines
541 B
Plaintext
Raw Normal View History

2020-02-01 18:34:59 +01:00
#!/usr/bin/env sh
2020-02-01 23:14:37 +01:00
2020-02-04 00:24:04 +01:00
set -eo pipefail
2020-02-01 18:34:59 +01:00
2020-12-31 13:22:05 +01:00
/usr/local/bin/gomplate -o /app/.env -f /etc/templates/env.tmpl
2020-02-01 18:34:59 +01:00
if [ -n "$VAULTWARDEN_DATABASE_URL" ]
2020-02-01 18:34:59 +01:00
then
WAITFOR_HOST=$(/usr/local/bin/url-parser host --url "$VAULTWARDEN_DATABASE_URL")
WAITFOR_PORT=$(/usr/local/bin/url-parser port --url "$VAULTWARDEN_DATABASE_URL")
2020-02-04 11:58:09 +01:00
printf "Wait for database server on '%s:%s' ...\n" "${WAITFOR_HOST}" "${WAITFOR_PORT:-5432}"
/usr/local/bin/wait-for "${WAITFOR_HOST}":"${WAITFOR_PORT:-5432}"
2020-02-01 18:34:59 +01:00
fi
2020-02-01 19:09:53 +01:00
printf "Start Vaultwarden Server ...\n"
exec /app/vaultwarden