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 Postgres container is runningif [ "$(docker ps -q -f name=annos-postgres)" ]; then echo "Postgres container is already running." export DB_RUNNING=trueelse echo "Starting Postgres container..." npm run db:start export DB_RUNNING=falsefi
# Trap SIGINT and SIGTERM to stop containers on exit, only if we started themfunction cleanup_postgres { if [ "$DB_RUNNING" = false ]; then if [ "$(docker ps -q -f name=annos-postgres)" ]; then echo "Stopping Postgres container..." npm run db:stop npm run db:remove fi fi}
# Export the cleanup function so it can be called from other scriptsexport -f cleanup_postgres