#!/bin/sh
set -eu

export HWLAB_SERVICE_ID=hwlab-hwpod-web
export HWLAB_SERVICE_ENTRYPOINT=cmd/hwlab-hwpod-web/main.ts
export HWPOD_WEB_PORT="${HWPOD_WEB_PORT:?HWPOD_WEB_PORT is required}"
export PORT="$HWPOD_WEB_PORT"

"${HWLAB_BUN_COMMAND:-bun}" run --cwd web/hwlab-cloud-web build:hwpod
exec "${HWLAB_BUN_COMMAND:-bun}" run cmd/hwlab-hwpod-web/main.ts
