diff --git a/docker/entrypoint.sh b/docker/entrypoint.sh index f432a4f..f37a38c 100644 --- a/docker/entrypoint.sh +++ b/docker/entrypoint.sh @@ -3,6 +3,17 @@ # Exit on any error set -e +# Check required Lemmy environment variables +if [ -z "$LEMMY_INSTANCE" ] || [ -z "$LEMMY_USERNAME" ] || [ -z "$LEMMY_PASSWORD" ] || [ -z "$LEMMY_COMMUNITY" ]; then + echo "ERROR: Missing required Lemmy configuration variables:" + echo " LEMMY_INSTANCE=${LEMMY_INSTANCE:-'(not set)'}" + echo " LEMMY_USERNAME=${LEMMY_USERNAME:-'(not set)'}" + echo " LEMMY_PASSWORD=${LEMMY_PASSWORD:-'(not set)'}" + echo " LEMMY_COMMUNITY=${LEMMY_COMMUNITY:-'(not set)'}" + echo "Please set all required environment variables before starting the application." + exit 1 +fi + # Wait for database to be ready until php artisan tinker --execute="DB::connection()->getPdo();" > /dev/null 2>&1; do echo "Waiting for database connection..."