| set -e | |
| # Start Redis in background | |
| redis-server --daemonize yes \ | |
| --maxmemory 64mb \ | |
| --maxmemory-policy allkeys-lru \ | |
| --bind 127.0.0.1 \ | |
| --port 6379 \ | |
| --save "" \ | |
| --appendonly no | |
| # Wait for Redis | |
| for i in $(seq 1 10); do | |
| redis-cli ping >/dev/null 2>&1 && break | |
| sleep 0.5 | |
| done | |
| # Set Redis connection | |
| export REDIS_CONN_STRING="redis://127.0.0.1:6379" | |
| # Start new-api | |
| exec /new-api --log-dir /tmp/logs | |