Skip to main content

scripts/run-local-stack.sh

Metadata

Indexed Symbols

No indexed functions/methods detected in this file.

Markdown Headings (if applicable)

No markdown headings detected.

Source Preview

#!/usr/bin/env bash
set -euo pipefail

ROOT_DIR="$(cd "$(dirname "$0")/.." && pwd)"
cd "$ROOT_DIR"

WORKSPACE_ID="${ANCHOR_WORKSPACE_ID:-00000000-0000-4000-8000-000000000001}"
DATABASE_URL="${DATABASE_URL:-postgres://anchor:anchor@localhost:5432/anchor}"
AGENTFIELD_WEBHOOK_SECRET="${AGENTFIELD_WEBHOOK_SECRET:-local-agentfield-secret}"
AUDIT_SIGNING_SECRET="${AUDIT_SIGNING_SECRET:-local-audit-signing-secret-for-dev-only}"
STATUS_API_TOKEN="${STATUS_API_TOKEN:-}"

cleanup() {
echo "\nStopping local processes..."
for pid in "${PIDS[@]:-}"; do
kill "$pid" >/dev/null 2>&1 || true
done
if [[ "${STOP_INFRA_ON_EXIT:-0}" == "1" ]]; then
docker compose -f infra/docker-compose.dev.yaml down >/dev/null 2>&1 || true
fi
}

trap cleanup EXIT INT TERM

echo "Starting local infra containers..."