#!/usr/bin/env bash

set -euo pipefail

ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
DEV_DIR="${DEV_DIR:-${ROOT_DIR}/.dev-worktree-8081}"

"${ROOT_DIR}/scripts/prepare_dev_worktree.sh"

cd "${DEV_DIR}"
docker compose -p mh-dashboard-organization-dev --env-file .env -f docker-compose.8081.yml up -d --build

echo "8081 started from ${DEV_DIR}"
echo "Verify mounts with:"
echo "  docker inspect mh-dashboard-organization-dev-backend-1 --format '{{range .Mounts}}{{println .Source \"->\" .Destination}}{{end}}'"
