On unraid, /mnt/user is the FUSE layer that applies share-routing policy (cache-first, mover, include/exclude). /mnt/cache bypasses that routing. Default rule: container bind mounts use /mnt/user/... unless there's a specific reason to pin to cache. Also broadens the daemon mount from just /multica/rounds to the whole /multica namespace. This means future subpaths (agents/<slug>/ for the credentials migration, coordinator-state/, etc.) are already visible without another daemon recreate. Per user: "multica both includes shared and not shared" — one mount covers both. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
42 lines
1.2 KiB
Bash
Executable File
42 lines
1.2 KiB
Bash
Executable File
#!/bin/bash
|
|
# Build + run the multica-coordinator container.
|
|
#
|
|
# Required env vars in /mnt/user/appdata/multica/coordinator-state/env:
|
|
# COORDINATOR_SERVER_URL
|
|
# COORDINATOR_WORKSPACE_ID
|
|
# COORDINATOR_TOKEN
|
|
# Optional: COORDINATOR_GITEA_BASE_URL, COORDINATOR_GIT_USERNAME, COORDINATOR_GIT_TOKEN
|
|
#
|
|
# Idempotent: stops/removes any prior container of the same name first.
|
|
set -euo pipefail
|
|
|
|
NAME="multica-coordinator"
|
|
IMAGE="multica-coordinator:latest"
|
|
CODE_DIR="/mnt/user/appdata/multica/coordinator"
|
|
STATE_DIR="/mnt/user/appdata/multica/coordinator-state"
|
|
ROUNDS_DIR="/mnt/user/appdata/multica/rounds"
|
|
NETWORK="multica"
|
|
|
|
mkdir -p "${STATE_DIR}" "${ROUNDS_DIR}"
|
|
|
|
echo "[1/3] building ${IMAGE} from ${CODE_DIR}"
|
|
docker build -q -t "${IMAGE}" "${CODE_DIR}" >/dev/null
|
|
|
|
echo "[2/3] stopping old ${NAME} (if any)"
|
|
docker rm -f "${NAME}" >/dev/null 2>&1 || true
|
|
|
|
echo "[3/3] starting ${NAME}"
|
|
docker run -d \
|
|
--name "${NAME}" \
|
|
--hostname "${NAME}" \
|
|
--restart unless-stopped \
|
|
--network "${NETWORK}" \
|
|
--env-file "${STATE_DIR}/env" \
|
|
-v "${CODE_DIR}:/opt/coordinator:ro" \
|
|
-v "${STATE_DIR}:/var/lib/coordinator" \
|
|
-v "${ROUNDS_DIR}:${ROUNDS_DIR}" \
|
|
"${IMAGE}"
|
|
|
|
echo "started ${NAME}. logs:"
|
|
echo " docker logs -f ${NAME}"
|