Use /bin/sh for entrypoint (no bash)

This commit is contained in:
decentral1se 2021-06-26 20:47:18 +02:00
parent 5e9ebb5e1a
commit e21c2484d7
No known key found for this signature in database
GPG Key ID: 5E2EF5A63E3718CC
2 changed files with 3 additions and 22 deletions

View File

@ -26,7 +26,6 @@ services:
networks:
- proxy
- internal
command: server start
entrypoint: /entrypoint.sh
volumes:
- app:/gotosocial/storage

View File

@ -1,25 +1,7 @@
#!/bin/bash
#!/bin/sh
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"
}
export GTS_DB_PASSWORD=$(cat "$GTS_DB_PASSWORD_FILE")
file_env "GTS_DB_PASSWORD"
exec "$@"
/gotosocial/gotosocial server start