#!/bin/sh # Set default storage type to Redis unless specified otherwise STORAGE_TYPE=${STORAGE_TYPE:-redis} # Conditional installations based on STORAGE_TYPE case "${STORAGE_TYPE}" in "redis") echo "Installing Redis..." npm install redis ;; "postgres") echo "Installing PostgreSQL..." npm install pg ;; "memcached") echo "Installing Memcached..." npm install memcached ;; "rethinkdb") echo "Installing RethinkDB..." npm install rethinkdbdash ;; esac # If TEST_MODE is true, install Mocha and run tests if [ "$TEST_MODE" = "true" ]; then echo "Installing Mocha for testing..." npm install mocha echo "Running tests..." npm test else # Normal startup # Generate config.js from environment variables cat > config.js <