#!/bin/bash echo "===== Application Startup at $(date) =====" # --- Step 1: Start Redis server with config --- echo "[INFO] Starting Redis server with persistence config..." redis-server /app/redis.conf --daemonize yes echo "[INFO] Redis server started." # --- Step 2: Wait for Redis to be ready --- echo "[INFO] Waiting for Redis to respond to PING..." until redis-cli ping | grep -q "PONG"; do echo "[INFO] Redis not ready yet..." sleep 2 done echo "[SUCCESS] Redis is ready." # --- Step 3: Start Node or Bun application --- echo "[INFO] Launching Node app..." exec bun run app.js