#!/usr/bin/env bash
set -euo pipefail

ROOT="/opt/tracker"

if [[ -f "${ROOT}/.env" ]]; then
  set -a
  # shellcheck disable=SC1091
  source "${ROOT}/.env"
  set +a
fi

WEB_PORT="${WEB_PORT:-3000}"

cd "${ROOT}/apps/web"
exec /usr/bin/npm start -- --hostname 0.0.0.0 --port "${WEB_PORT}"
