···1616 DB_RUNNING=false
1717fi
18181919-# Check if the Redis container is running
2020-if [ "$(docker ps -q -f name=annos-redis)" ]; then
2121- echo "Redis container is already running."
2222- REDIS_RUNNING=true
2323-else
2424- echo "Starting Redis container..."
2525- npm run redis:start
2626- REDIS_RUNNING=false
2727-fi
28192920# Trap SIGINT and SIGTERM to stop containers on exit, only if we started them
3021function cleanup {
···3324 echo "Stopping Postgres container..."
3425 npm run db:stop
3526 npm run db:remove
3636- fi
3737- fi
3838-3939- if [ "$REDIS_RUNNING" = false ]; then
4040- if [ "$(docker ps -q -f name=annos-redis)" ]; then
4141- echo "Stopping Redis container..."
4242- npm run redis:stop
4343- npm run redis:remove
4427 fi
4528 fi
4629}