generated from coop-cloud/example
Use /bin/sh for entrypoint (no bash)
This commit is contained in:
parent
5e9ebb5e1a
commit
e21c2484d7
|
@ -26,7 +26,6 @@ services:
|
||||||
networks:
|
networks:
|
||||||
- proxy
|
- proxy
|
||||||
- internal
|
- internal
|
||||||
command: server start
|
|
||||||
entrypoint: /entrypoint.sh
|
entrypoint: /entrypoint.sh
|
||||||
volumes:
|
volumes:
|
||||||
- app:/gotosocial/storage
|
- app:/gotosocial/storage
|
||||||
|
|
|
@ -1,25 +1,7 @@
|
||||||
#!/bin/bash
|
#!/bin/sh
|
||||||
|
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
file_env() {
|
export GTS_DB_PASSWORD=$(cat "$GTS_DB_PASSWORD_FILE")
|
||||||
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 "GTS_DB_PASSWORD"
|
/gotosocial/gotosocial server start
|
||||||
|
|
||||||
exec "$@"
|
|
||||||
|
|
Loading…
Reference in New Issue