max/entrypoint.sh
FinnStutzenstein 9d018e00be initial commit
2020-04-13 08:31:44 +02:00

17 lines
377 B
Bash
Executable File

#!/bin/bash
if [ -z "$PGSQL_HOST" ]
then
echo "Note: Postgresql not set!!"
else
export PGSQL_PORT="${PGSQL_PORT:-5432}"
wait-for-it --timeout=15 "$PGSQL_HOST:$PGSQL_PORT"
# Create schema in postgresql
export PGPASSWORD="$PGSQL_PASSWORD"
psql -1 -h "$PGSQL_HOST" -p "$PGSQL_PORT" -U "$PGSQL_USER" -d "$PGSQL_NAME" -f max/db/schema.sql
fi
exec "$@"