2023-08-16 20:50:01 -07:00
|
|
|
#!/usr/bin/env sh
|
2023-06-08 08:01:07 -07:00
|
|
|
|
2024-02-18 16:03:01 -07:00
|
|
|
lib_path="/usr/lib/$(arch)-linux-gnu/libmimalloc.so.2"
|
|
|
|
export LD_PRELOAD="$lib_path"
|
2023-08-01 18:56:10 -07:00
|
|
|
|
2023-08-01 15:07:52 -07:00
|
|
|
if [ "$DB_URL_FILE" ]; then
|
2024-02-18 16:03:01 -07:00
|
|
|
DB_URL_CONTENT=$(cat "$DB_URL_FILE")
|
|
|
|
export DB_URL="$DB_URL_CONTENT"
|
2023-08-01 15:07:52 -07:00
|
|
|
unset DB_URL_FILE
|
|
|
|
fi
|
|
|
|
|
2023-06-08 08:01:07 -07:00
|
|
|
if [ "$DB_HOSTNAME_FILE" ]; then
|
2024-02-18 16:03:01 -07:00
|
|
|
DB_HOSTNAME_CONTENT=$(cat "$DB_HOSTNAME_FILE")
|
|
|
|
export DB_HOSTNAME="$DB_HOSTNAME_CONTENT"
|
2023-06-08 08:01:07 -07:00
|
|
|
unset DB_HOSTNAME_FILE
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ "$DB_DATABASE_NAME_FILE" ]; then
|
2024-02-18 16:03:01 -07:00
|
|
|
DB_DATABASE_CONTENT=$(cat "$DB_DATABASE_NAME_FILE")
|
|
|
|
export DB_DATABASE_NAME="$DB_DATABASE_CONTENT"
|
2023-06-08 08:01:07 -07:00
|
|
|
unset DB_DATABASE_NAME_FILE
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ "$DB_USERNAME_FILE" ]; then
|
2024-02-18 16:03:01 -07:00
|
|
|
DB_USERNAME_CONTENT=$(cat "$DB_USERNAME_FILE")
|
|
|
|
export DB_USERNAME="$DB_USERNAME_CONTENT"
|
2023-06-08 08:01:07 -07:00
|
|
|
unset DB_USERNAME_FILE
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ "$DB_PASSWORD_FILE" ]; then
|
2024-02-18 16:03:01 -07:00
|
|
|
DB_PASSWORD_CONTENT=$(cat "$DB_PASSWORD_FILE")
|
|
|
|
export DB_PASSWORD="$DB_PASSWORD_CONTENT"
|
2023-06-08 08:01:07 -07:00
|
|
|
unset DB_PASSWORD_FILE
|
|
|
|
fi
|
|
|
|
|
2023-07-15 08:30:52 -07:00
|
|
|
if [ "$REDIS_PASSWORD_FILE" ]; then
|
2024-02-18 16:03:01 -07:00
|
|
|
REDIS_PASSWORD_CONTENT=$(cat "$REDIS_PASSWORD_FILE")
|
|
|
|
export DB_PASSWORD="$REDIS_PASSWORD_CONTENT"
|
2023-07-15 08:30:52 -07:00
|
|
|
unset REDIS_PASSWORD_FILE
|
|
|
|
fi
|
|
|
|
|
2024-02-18 16:03:01 -07:00
|
|
|
exec node /usr/src/app/dist/main "$@"
|