ccm's picture
Trying to make the agents module visible
2f7eb5d
raw
history blame contribute delete
997 Bytes
#!/bin/bash
set -euo pipefail
# Ensure our local /app packages (e.g., agents) are importable
export PYTHONPATH="/app:${PYTHONPATH:-}"
# --- Start Mongo ---
mkdir -p "$HOME/data/db" "$HOME/logs"
mongod --dbpath "$HOME/data/db" \
--bind_ip 127.0.0.1 \
--logpath "$HOME/logs/mongod.log" \
--fork
# --- Start the Python proxy with dotenv (DO NOT source .env in bash) ---
# Loads /app/.env first, then overrides with /app/.env.local
npx dotenv -e /app/.env -e /app/.env.local -c -- \
sh -lc 'cd /app && python3 -m uvicorn --app-dir /app proxy:app --host 127.0.0.1 --port 8000' &
# --- Wait for proxy health ---
for i in {1..40}; do
if curl -fsS http://127.0.0.1:8000/healthz >/dev/null; then
echo "[entrypoint] Proxy is up"
break
fi
echo "[entrypoint] Waiting for proxy..."
sleep 0.5
done
# --- Start Chat-UI under dotenv as well ---
npx dotenv -e /app/.env -e /app/.env.local -c -- \
node /app/build/index.js -- --host 0.0.0.0 --port 3000
wait -n
exit $?