Files
ThothII/docker/core-entrypoint.sh
T
User 5f6647e77a fix(entrypoint): restore server case (lost during doctor->check refactor)
Il caso 'server)' era stato eliminato inavvertitamente: CMD [server]
cadeva nel *) exec $@ -> 'server: not found' (exit 127).
Smoke standalone ora verde: health + config check + db ping (read-only).
2026-07-12 17:17:24 +02:00

31 lines
760 B
Bash
Executable File

#!/usr/bin/env bash
# Entrypoints logici del container thothii-core:
# server (default) | check | tht <args...> | preprocess <args...>
# THT_CONFIG punta al workspace attivo (local.yaml nel deploy co-locato).
set -euo pipefail
export THT_CONFIG="${THT_CONFIG:-/app/harness/workspaces/local.yaml}"
cmd="${1:-server}"
case "$cmd" in
server)
exec node /app/backend/dist/server.js
;;
check)
# Diagnostica di wiring: validazione config/env + ping DWH (read-only).
shift
tht config check -c "$THT_CONFIG"
tht db ping -c "$THT_CONFIG" || echo "(db ping non verde: verificare .env/ruoli/VPN)"
;;
tht)
shift
exec tht "$@"
;;
preprocess)
shift
exec tht evidence index "$@"
;;
*)
exec "$@"
;;
esac