2026-09-03 12:46:14 +00:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
set -euo pipefail
|
|
|
|
|
root="$(cd "$(dirname "$0")/.." && pwd)"
|
|
|
|
|
cd "$root"
|
2026-09-05 09:41:44 +00:00
|
|
|
docker compose -f docker-compose.yml -f docker-compose.dev.yml up -d postgres
|
2026-09-03 12:46:14 +00:00
|
|
|
echo "waiting for postgres..."
|
|
|
|
|
for _ in $(seq 1 40); do
|
|
|
|
|
if docker compose exec -T postgres pg_isready -U lazyboy >/dev/null 2>&1; then
|
|
|
|
|
break
|
|
|
|
|
fi
|
|
|
|
|
sleep 0.5
|
|
|
|
|
done
|
|
|
|
|
if [[ -f "$root/.env" ]]; then
|
|
|
|
|
set -a
|
|
|
|
|
# shellcheck disable=SC1091
|
|
|
|
|
source "$root/.env"
|
|
|
|
|
set +a
|
|
|
|
|
fi
|
|
|
|
|
export DATABASE_URL="${DATABASE_URL:-postgres://lazyboy:lazyboy@127.0.0.1:5434/lazyboy}"
|
2026-09-03 23:43:37 +00:00
|
|
|
: "${SANDBOX_SUPERVISOR_TOKEN:?Set a random SANDBOX_SUPERVISOR_TOKEN of at least 32 characters in .env}"
|
|
|
|
|
export SANDBOX_SUPERVISOR_URL="${SANDBOX_SUPERVISOR_URL:-http://127.0.0.1:7091}"
|
2026-09-03 12:46:14 +00:00
|
|
|
export SANDBOX_PROVIDER="${SANDBOX_PROVIDER:-docker}"
|
|
|
|
|
export DATA_DIR="${DATA_DIR:-$root/data}"
|
|
|
|
|
export API_BIND="${API_BIND:-0.0.0.0:3101}"
|
|
|
|
|
export LAZYBOY_WEB_DIR="$root/apps/web"
|
|
|
|
|
mkdir -p "$DATA_DIR"
|
2026-09-03 23:43:37 +00:00
|
|
|
echo "start supervisor in another terminal with the same .env: cargo run -p lazyboy-supervisor"
|
2026-09-09 16:59:32 +00:00
|
|
|
echo "then: cargo run -p lazyboy-api (register the first account in the browser)"
|
2026-09-03 12:46:14 +00:00
|
|
|
echo "listening on 0.0.0.0:3101"
|