#!/bin/bash # deploy-local.sh — Build the image locally and run it against .env.local. # # Useful for iterating on prompts/skills without touching the cluster. set -euo pipefail SCRIPT_DIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd) AGENT_DIR=$(cd "${SCRIPT_DIR}/.." && pwd) APP_NAME="" PORT=8000 ENV_FILE="${AGENT_DIR}/.env.local" if [ ! -f "${ENV_FILE}" ]; then echo "ERROR: ${ENV_FILE} not found. Copy .env.local.example first." >&2 exit 1 fi # Pick docker or podman if command -v docker >/dev/null; then RUNTIME=docker elif command -v podman >/dev/null; then RUNTIME=podman else echo "ERROR: neither docker nor podman found on PATH" >&2 exit 1 fi echo "Building ${APP_NAME}:local with ${RUNTIME}..." "${RUNTIME}" build -t "${APP_NAME}:local" "${AGENT_DIR}" echo "Running ${APP_NAME}:local on http://localhost:${PORT} ..." exec "${RUNTIME}" run --rm -it \ --name "${APP_NAME}" \ -p "${PORT}:${PORT}" \ --env-file "${ENV_FILE}" \ "${APP_NAME}:local"