membersystem/entrypoint.sh

22 lines
459 B
Bash
Raw Normal View History

#!/bin/sh
2021-02-28 22:03:32 +00:00
echo "Waiting for postgres..."
POSTGRES_PORT=${POSTGRES_PORT:-5432}
POSTGRES_HOST=${POSTGRES_HOST:-localhost}
while ! nc -z "$POSTGRES_HOST" "$POSTGRES_PORT"; do
sleep 0.1
done
echo "PostgreSQL started"
2021-02-28 22:55:01 +00:00
# Only migrate, collectstatic and compilemessages if we are NOT in development
if [ -z "$DEBUG" ]; then
python src/manage.py migrate;
python src/manage.py collectstatic --no-input;
python src/manage.py compilemessages;
fi
2021-02-28 22:03:32 +00:00
exec "$@"