#!/bin/sh set -eu # Legacy import: if /data/cherry.db is empty and script_metadata.json exists # in the mounted zombies tree, run a one-shot import before starting. if [ -n "${LEGACY_METADATA:-}" ] && [ -f "$LEGACY_METADATA" ]; then if [ ! -f "${DB_PATH:-/data/cherry.db}" ] || [ ! -s "${DB_PATH:-/data/cherry.db}" ]; then echo "[entrypoint] running legacy import from $LEGACY_METADATA" node build/scripts/import-legacy.js || echo "[entrypoint] legacy import failed — continuing" fi fi echo "[entrypoint] starting node server on ${HOST:-0.0.0.0}:${PORT:-3000}" exec node build/index.js