Something went wrong. Try again.
A social knowledge tool for research trails, built on ATProto semble.so
research-tool social-network tools-for-thought atproto
Something went wrong. Try again.
1234567891011121314151617181920212223242526272829303132#!/bin/bash
# Check if Docker daemon is runningif ! docker info > /dev/null 2>&1; then echo "Error: Docker daemon is not running. Please start Docker and try again." exit 1fi
# Check if the Redis container is runningif [ "$(docker ps -q -f name=annos-redis)" ]; then echo "Redis container is already running." export REDIS_RUNNING=trueelse echo "Starting Redis container..." npm run redis:start export REDIS_RUNNING=falsefi
# Trap SIGINT and SIGTERM to stop containers on exit, only if we started themfunction cleanup_redis { if [ "$REDIS_RUNNING" = false ]; then if [ "$(docker ps -q -f name=annos-redis)" ]; then echo "Stopping Redis container..." npm run redis:stop npm run redis:remove fi fi}
# Export the cleanup function so it can be called from other scriptsexport -f cleanup_redis