#!/bin/bash set -e # Create Chroma data directory if missing if [ ! -d "/data/chroma" ]; then echo "[DEBUG] Creating /data/chroma" mkdir -p /data/chroma fi # Create Flowise log directory if missing if [ ! -d "/data/.flowise/logs" ]; then echo "[DEBUG] Creating /data/.flowise/logs" mkdir -p /data/.flowise/logs fi # Start Chroma in the background echo "[DEBUG] Starting Chroma..." chroma run --path /data/chroma --host 0.0.0.0 --port 8000 & # Wait for Chroma to become ready echo "--- Waiting for Chroma API ---" until curl -s http://localhost:8000/api/v2/heartbeat >/dev/null; do echo "[DEBUG] Chroma not ready yet. Retrying..." sleep 1 done echo "--- Chroma API is up ---" # Check collections echo "[DEBUG] Testing Chroma collections endpoint:" curl -s http://localhost:8000/api/v2/collections || true # Start Flowise echo "[DEBUG] Starting Flowise..." npx flowise start