harb/containers/landing-dev-entrypoint.sh

24 lines
685 B
Bash
Raw Normal View History

#!/usr/bin/env bash
set -euo pipefail
ROOT_DIR=/workspace
LANDING_DIR=$ROOT_DIR/landing
REQUIRED_DIST="$ROOT_DIR/kraiken-lib/dist/index.js"
if [[ ! -f "$REQUIRED_DIST" ]]; then
echo "[landing-entrypoint] ERROR: Run ./scripts/build-kraiken-lib.sh before starting containers" >&2
exit 1
fi
cd "$LANDING_DIR"
echo "[landing-entrypoint] Installing dependencies..."
npm install --no-save --loglevel error 2>&1 || {
echo "[landing-entrypoint] npm install failed, trying with --force"
npm install --force --no-save --loglevel error
}
export CHOKIDAR_USEPOLLING=${CHOKIDAR_USEPOLLING:-1}
export HOST=0.0.0.0
export PORT=${PORT:-5174}
exec npm run dev -- --host 0.0.0.0 --port 5174