membersystem/entrypoint.sh
Benjamin Bach 24f3c30a41
Some checks failed
continuous-integration/drone/pr Build is failing
Revert "Remove health-check for Postgres (it's now in docker-compose.yml)"
This reverts commit 0f1211fa83.
2024-07-24 14:07:06 +02:00

22 lines
459 B
Bash
Executable file

#!/bin/sh
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"
# 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
exec "$@"