Files
Thinh Lam 688fac73e9
CI/CD / backend (push) Failing after 2m8s
CI/CD / frontend (push) Failing after 1m40s
CI/CD / deploy (push) Has been skipped
sciagent code + Gitea Actions CI/CD
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-30 09:38:30 +07:00

47 lines
1.6 KiB
Bash
Executable File
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
#!/bin/bash
if command -v ollama >/dev/null 2>&1; then
echo "Starting Ollama server..."
ollama serve &
sleep 1
else
echo "Ollama not installed in this image; skipping."
fi
# if ! ollama list | grep -q "qwen2.5:3b"; then
# echo "Model qwen2.5:3b not found. Pulling..."
# ollama pull qwen2.5:3b
# else
# echo "Model qwen2.5:3b already exists. Skipping pull."
# fi
# #download embedding model
# if ! ollama list | grep -q "embeddinggemma:300m"; then
# echo "Model embeddinggemma:300m not found. Pulling..."
# ollama pull embeddinggemma:300m
# else
# echo "Model embeddinggemma:300m already exists. Skipping pull."
# fi
# NLTK corpora are installed when the image is built (see Dockerfile).
# Bind mount overwrites /app; image site-packages may be stale vs mounted requirements.txt.
if [ -f /app/requirements.txt ]; then
echo "Installing/updating Python deps from mounted /app/requirements.txt..."
pip install --no-cache-dir -r /app/requirements.txt || {
echo "ERROR: pip install -r /app/requirements.txt failed; fix deps and restart be0."
exit 1
}
fi
echo "Applying idempotent initiative DB migrations (008014 incl. registration_otp_codes) if needed..."
python /app/scripts/apply_initiative_migrations.py || echo "WARNING: apply_initiative_migrations exited non-zero — check be0 logs (API may return 503 for evidence/artifacts until DB is fixed)."
echo "Starting FastAPI..."
if [ "${UVICORN_RELOAD:-0}" = "1" ]; then
exec uvicorn main:app --host 0.0.0.0 --port 4402 --reload
else
exec uvicorn main:app --host 0.0.0.0 --port 4402
fi