superset/docker/init_superset.sh
2025-02-01 14:33:43 +00:00

19 lines
594 B
Bash

#!/bin/sh
echo "Performing initial setup..."
# Run database migration and create admin user
superset db upgrade
superset fab create-admin \
--username "${SUPERSET_ADMIN_USERNAME:-admin}" \
--firstname "${SUPERSET_ADMIN_FIRSTNAME:-Admin}" \
--lastname "${SUPERSET_ADMIN_LASTNAME:-User}" \
--email "${SUPERSET_ADMIN_EMAIL:-admin@example.com}" \
--password "${SUPERSET_ADMIN_PASSWORD:-admin}" \
|| echo "Admin user already exists, skipping creation."
# Initialize Superset
superset init
echo "Setup already done, skipping initialization steps."