#!/bin/sh set -e CONFIG_FILE_PATH="/home/api.yaml" echo "DEBUG: Entrypoint script started." if [ -z "$API_YAML_CONTENT" ]; then echo "ERROR: Secret 'API_YAML_CONTENT' does not exist or is empty. Exiting." exit 1 else echo "DEBUG: API_YAML_CONTENT secret found. Preparing to write..." printf '%s\n' "$API_YAML_CONTENT" > "$CONFIG_FILE_PATH" echo "DEBUG: Attempted to write to $CONFIG_FILE_PATH." if [ -f "$CONFIG_FILE_PATH" ]; then echo "DEBUG: File $CONFIG_FILE_PATH created successfully. Size: $(wc -c < "$CONFIG_FILE_PATH") bytes." echo "DEBUG: First few lines (without sensitive info):" head -n 3 "$CONFIG_FILE_PATH" | grep -v "api:" | grep -v "password" || echo "No non-sensitive lines to display" else echo "ERROR: File $CONFIG_FILE_PATH was NOT created." exit 1 fi fi echo "DEBUG: About to execute python main.py..." cd /home exec python main.py "$@"