ToolJet/server/entrypoint.sh
2022-10-10 13:58:12 +05:30

18 lines
303 B
Bash
Executable file

#!/bin/bash
set -e
if [ -d "./server/dist" ]
then
SETUP_CMD='npm run db:setup:prod'
else
SETUP_CMD='npm run db:setup'
fi
if [ -f "./.env" ]
then
declare $(grep -v '^#' ./.env | xargs)
fi
./server/scripts/wait-for-it.sh $PG_HOST:${PG_PORT:-5432} --strict --timeout=300 -- $SETUP_CMD
exec "$@"