#!/bin/bash set -euo pipefail ROLE="${ROLE:-web}" if [[ "$ROLE" == "web" ]]; then echo "[entrypoint] waiting for database..." python manage.py wait_for_db --timeout 60 || true echo "[entrypoint] running migrations..." python manage.py migrate --noinput if [[ "${DJANGO_DEBUG:-False}" != "True" ]]; then echo "[entrypoint] collecting static files..." python manage.py collectstatic --noinput --clear fi fi echo "[entrypoint] starting role=$ROLE: $*" exec "$@"