#!/usr/bin/env sh
set -eu

cd /workspace
/bin/sh ./scripts/sync_userfront_locales.sh

cd /workspace/userfront
set -- flutter run \
  -d web-server \
  --web-hostname 0.0.0.0 \
  --web-port "${USERFRONT_INTERNAL_PORT:-5000}" \
  --wasm \
  --dart-define=CLIENT_LOG_DEBUG="${CLIENT_LOG_DEBUG:-false}" \
  --dart-define=APP_ENV="${APP_ENV:-dev}" \
  ${USERFRONT_FLUTTER_RUN_FLAGS:-} \
  --no-web-resources-cdn

exec "$@"
